How to read/write byte[] into Isolated storage

▼魔方 西西 提交于 2020-01-01 06:50:15

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!