问题
Can anyone tell me how to read and write byte array into Isolated Storage file in WP7?
回答1:
IsolatedStorageFileSystem
has a method for writing byte arrays:
public override void Write(byte[] buffer, int offset, int count);
It can be used as follows:
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);
}
来源:https://stackoverflow.com/questions/6420565/how-to-read-write-byte-into-isolated-storage