0
votes

How can i (Create,Read,Write,Delete) Files and Directories in Isolated Storage on Windows Phone?(VB.Net)(Visual Studio 2012)


i use this codes but i see some error.

Create file:

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

read form isolated storage:

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

read file:

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

Delete file:

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

Delete folder:

file.DeleteDirectory("Temp")

Create folder:

Dim file As IsolatedStorageFile = IsolatedStorageFile.GetUserStoreForApplication()
file.CreateDirectory("FirstRun")
1
I see some error What error you are getting..?amir_salar

1 Answers

0
votes

Please refer this link for isolated storage. This is best for isolated storage beginners..

Isolated Storage