windows-phone-7 - 如何将字节 [] 读/写到隔离存储中

标签 windows-phone-7

谁能告诉我如何在 WP7 中读取和写入字节数组到独立存储文件中?

最佳答案

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);
  }

关于windows-phone-7 - 如何将字节 [] 读/写到隔离存储中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6420565/

相关文章:

wpf - stackpanel中的背景颜色变化

c# - e.ChosenPhoto 的 Base64 显然已损坏

windows-phone-7 - 如何在 Windows Phone Mango 上打开自定义相册

windows - WP7 Horizo​​ntal ListBox 末尾的项目被切断

silverlight - 使用 MVVM 处理应用程序事件的首选方法

c# - 使用 WP7 和 WP8 之间共享的 LongListSelector 的屏幕

javascript - 网络浏览器 Windows Phone 7 中的上下文菜单

mysql - 使用 windows phone 7 使用 mySQL 数据库

android - 哪种媒体格式更适合所有移动开发?

xaml - WP7 - 在类型 'Resources' 中找不到可附加属性 'PhoneApplicationPage'