我有一些字节写入我的 Silverlight 应用程序的隔离存储中的文件。该文件名为“data.dat”。我使用以下代码将其写入独立存储:
// Store the data in isolated storage
var bytes = GetData();
using (IsolatedStorageFile storage = IsolatedStorageFile.GetUserStoreForApplication())
{
using (IsolatedStorageFileStream file = new IsolatedStorageFileStream("data.dat", FileMode.Create, storage))
{
file.Write(bytes, 0, bytes.Length);
}
}
我的问题是,一旦它们存在,我如何从隔离存储中检索字节?我看到的一切都返回一个字符串。但我看不到返回二进制数据的方法。
谢谢。