0
我的Silverlight應用程序中有一些字節寫入獨立存儲中的文件。這個文件被命名爲「data.dat」。我使用下面的代碼就寫信給獨立存儲:從Silverlight中的IsolatedStorage中讀取二進制數據
// 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);
}
}
我的問題是,我該如何找回從獨立存儲字節,一旦他們在那裏?我看到的一切都會返回一個字符但我沒有看到返回二進制數據的方法。
謝謝。
在你的代碼什麼是「數據」? – lamarant 2011-08-09 22:35:48
萊昂 - 我認爲這意味着'輸出'。因此,要麼改變'數據'爲'輸出',要麼改變字節[]輸出;到byte []數據; – 2011-08-17 01:42:23