WP7模拟器内存​​访问

发布于 2024-12-12 07:25:25 字数 56 浏览 0 评论 0原文

我下载一个文件并将其保存在独立存储中。我想知道是否有办法查看模拟器内存​​中的文件。有什么方法吗?

I make the download of a file and save it with isolated storage.. I want to know if i have a way to see the file in the memory of the emulator.. theres some way?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

時窥 2024-12-19 07:25:25

从 IO 角度来看,模拟器中的隔离存储就像真实设备上的隔离存储一样。例如,要将文本文件保存到独立存储,请执行以下操作:

IsolatedStorageFile myIsolatedStorage = IsolatedStorageFile.GetUserStoreForApplication();

//create new file
using (StreamWriter writeFile = new StreamWriter(new IsolatedStorageFileStream("myFile.txt", FileMode.Create, FileAccess.Write, myIsolatedStorage)))
{
    string someTextData = "This is some text data to be saved in a new text file in the IsolatedStorage!";
    writeFile.WriteLine(someTextData);
    writeFile.Close();
}

从独立存储中读取文本文件:

IsolatedStorageFile myIsolatedStorage = IsolatedStorageFile.GetUserStoreForApplication();
IsolatedStorageFileStream fileStream = myIsolatedStorage.OpenFile("myFile.txt", FileMode.Open, FileAccess.Read);
using (StreamReader reader = new StreamReader(fileStream))
{    //Visualize the text data in a TextBlock text
    this.text.Text = reader.ReadLine();
}

windowsphonegeek

Isolated storage in Emulator is just like an isolated storage on a real device from IO point of view. For example, to save a text file to an isolated storage call:

IsolatedStorageFile myIsolatedStorage = IsolatedStorageFile.GetUserStoreForApplication();

//create new file
using (StreamWriter writeFile = new StreamWriter(new IsolatedStorageFileStream("myFile.txt", FileMode.Create, FileAccess.Write, myIsolatedStorage)))
{
    string someTextData = "This is some text data to be saved in a new text file in the IsolatedStorage!";
    writeFile.WriteLine(someTextData);
    writeFile.Close();
}

To read it from isolated storage:

IsolatedStorageFile myIsolatedStorage = IsolatedStorageFile.GetUserStoreForApplication();
IsolatedStorageFileStream fileStream = myIsolatedStorage.OpenFile("myFile.txt", FileMode.Open, FileAccess.Read);
using (StreamReader reader = new StreamReader(fileStream))
{    //Visualize the text data in a TextBlock text
    this.text.Text = reader.ReadLine();
}

Examples are provided by windowsphonegeek

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文