如何在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")