码迷,mamicode.com
首页 > Web开发 > 详细

Silverlight独立存储

时间:2014-06-24 23:37:43      阅读:224      评论:0      收藏:0      [点我收藏+]

标签:style   class   blog   code   http   tar   

bubuko.com,布布扣
 1   private void Button_Click_1(object sender, RoutedEventArgs e)
 2         {
 3             IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForApplication();
 4             using (Stream stream=isf.CreateFile("Weather.txt"))
 5             {
 6                 using (StreamWriter writer=new StreamWriter(stream))
 7                 {
 8                     writer.WriteLine(time.Text);
 9                     writer.WriteLine(time1.Text);
10                     writer.WriteLine(time2.Text);
11                     writer.WriteLine(time3.Text);
12                 }
13             }
14         }
View Code

bubuko.com,布布扣
 1  private void Button_Click_2(object sender, RoutedEventArgs e)
 2         {
 3             IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForApplication();
 4             if (isf.FileExists("Weather.txt"))
 5             {
 6                 using (Stream stream = isf.OpenFile("Weather.txt", FileMode.Open))
 7                 {
 8                     using (StreamReader reader = new StreamReader(stream))
 9                     {
10                         string line = reader.ReadToEnd();
11 
12                     }
13                 }
14             }
15         }
View Code

IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForApplication();
isf.DeleteFile("Weather.txt");

 

 

 

Silverlight独立存储,布布扣,bubuko.com

Silverlight独立存储

标签:style   class   blog   code   http   tar   

原文地址:http://www.cnblogs.com/zxbzl/p/3805664.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!