【问题标题】:isolated storage - windowsphone隔离存储-windowsphone
【发布时间】:2014-09-06 22:41:09
【问题描述】:

如何在 Windows Phone 上的独立存储中(创建、读取、写入、删除)文件和目录?(VB.Net)(Visual Studio 2012)


我使用此代码 但我看到了一些错误。

创建文件:

Dim sw As New StreamWriter(New IsolatedStorageFileStream("FirstRun\a.txt", FileMode.Create, file))
sw.WriteLine(Textbox1.text)

读取表单隔离存储:

Dim file As IsolatedStorageFile = IsolatedStorageFile.GetUserStoreForApplication()
file.CreateDirectory("UserTexts")
Dim sw As New StreamReader(New IsolatedStorageFileStream("UserTexts\user.txt", FileMode.Open, file))

读取文件:

TXTBlock.Text = sw.ReadToEnd()
sw.Close()

删除文件:

Dim file As IsolatedStorageFile = IsolatedStorageFile.GetUserStoreForApplication()
file.DeleteFile("Temp\a.farsmob")

删除文件夹:

file.DeleteDirectory("Temp")

创建文件夹:

Dim file As IsolatedStorageFile = IsolatedStorageFile.GetUserStoreForApplication()
file.CreateDirectory("FirstRun")

【问题讨论】:

  • 我看到一些错误您遇到了什么错误..?

标签: vb.net visual-studio-2012 windows-phone-8 isolatedstorage


【解决方案1】:

请参阅此链接了解隔离存储。这最适合隔离存储初学者..

Isolated Storage

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-01-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多