- IsolatedStorageFile _isf;
- public Page1()
- {
- InitializeComponent();
- _isf = IsolatedStorageFile.GetUserStoreForApplication();
- }
- // 写操作
- IsolatedStorageFileStream fileStream = new IsolatedStorageFileStream("test.txt", FileMode.Create, FileAccess.Write, _isf);
- StreamWriter writer = new StreamWriter(fileStream);
- writer.WriteLine("IsolatedStorage");
- writer.Close();
- // 读操作
- IsolatedStorageFileStream fileStream = new IsolatedStorageFileStream("test.txt", FileMode.Open, FileAccess.Read, _isf);
- StreamReader reader = new StreamReader(fileStream);
- this.PageTitle.Text = reader.ReadToEnd();
- reader.Close();
IsolatedStorage文件读写
最新推荐文章于 2024-05-16 19:32:24 发布