有谁能告诉我如何在WP7中读取和写入字节数组到隔离存储文件?
答案 0 :(得分:15)
IsolatedStorageFileSystem
有一个写字节数组的方法:
public override void Write(byte[] buffer, int offset, int count);
可以按如下方式使用:
byte[] myByteArray = ...
using (var store = IsolatedStorageFile.GetUserStoreForApplication())
using (var stream = new IsolatedStorageFileStream("filename.txt",
FileMode.Create, FileAccess.Write, store))
{
stream.Write(myByteArray, 0, myByteArray.Length);
}