Emulator xotirasi WP7 ga kirish

Faylni yuklab olishni va xavfsiz holatga saqlash bilan saqlashni istayman .. Emulyatorning xotirasida faylni ko'rishning yo'lini bilamanmi ... bilasizmi?

0

2 javoblar

Emulatorda ajratilgan xotira, xuddi IO nuqtai nazaridan haqiqiy qurilmadagi alohida xavfsizroq saqlashga o'xshaydi. Masalan, matn faylini ajratilgan saqlash qo'ng'iroqlariga saqlash uchun:

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();
}

Uni xavfsiz holatga saqlash joyidan o'qish uchun:

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

2
qo'shib qo'ydi

Bu erda quyidagi havolani ajratib turadigan narsalar haqida menga hamma narsa yordam berdi. Umid qilamanki bu sizga yordam beradi.

Xavfsiz saqlash

1
qo'shib qo'ydi