Silverlight独立存储之读写文本文件
来源:互联网 发布:淘宝店铺客服怎么服务 编辑:程序博客网 时间:2024/05/02 09:26
Silverlight独立存储之读写文件
(2012-04-16 23:38:03)引用
using System.IO;
using System.IO.IsolatedStorage;
激发按钮事件 写入
private boid button_Click(object sender,System.Windows.RotedEventArgs e){
if(this.textbox.Text=="" || this.passwordbox.Password==""){
MessageBox.Show("缺少输入信息");
}
IsolatedStorageFileStream isoStore=new IsolatedStorageFileStream("myinfo.txt",FileMode.Create,IsolatedStorageFile.GetUserStoreForApplication());
StreamWriter wtxt=new StreamWriter(isoStore);
wtxt.WriteLine(this.textbox.Text.Trim());
wtxt.WriteLine(this.passwordbox.Password.Trim());
wtxt.Close();
isoStore.Close();
MessageBox.Show("独立存储吸入myinfo.txt完成!");
}
激发按钮事件读出
private boid buttonread_Click(object sender,System.Windows.RotedEventArgs e){
this.textblock.Text="";
if(!IsolatedStorageFile.GetUserStoreForApplication().FileExists("myinfo.txt")){
MessageBox.Show("没有可用的独立存储文件!");
}
IsolatedStorageFileStream isoStore=new IsolatedStorageFileStream("myinfo.txt",FileMode.Open,IsolatedStorageFile.GetUserStoreForApplication());
StreamReader rtxt=new StreamReader(isoStore);
this.textblock.Text=rtxt.ReadLine();
this.textblock.Text+="\r\n";
this.textblock.Text+=rtxt.ReadLine();
rtxt.Close();
isoStore.Close();
}
点击打开链接
http://blog.sina.com.cn/s/blog_7131d05a01012llv.html
using System.IO;
using System.IO.IsolatedStorage;
激发按钮事件 写入
private boid button_Click(object sender,System.Windows.RotedEventArgs e){
}
激发按钮事件
private boid buttonread_Click(object sender,System.Windows.RotedEventArgs e){
}
点击打开链接
- Silverlight独立存储之读写文本文件
- Silverlight独立存储之读写文件
- Silverlight之独立存储(10)
- silverlight 独立存储
- 稳扎稳打Silverlight(16) - 2.0数据之独立存储(Isolated Storage)
- Silverlight Isolated Storage 独立存储
- Silverlight Isolated Storage 独立存储
- 解读Silverlight中独立存储
- Silverlight 独立存储配置
- 详解Silverlight 2中的独立存储
- 详解Silverlight 2中的独立存储(转载)
- 详解Silverlight 2中的独立存储
- QT学习 之 文本文件读写
- MFC之三文本文件读写
- Windows Phone开发之独立存储、文件的读写、ListBox绑定数据、NavigationService实现XAML跳转
- WP8_读写XML WP8数据存储--独立存储文件
- Java IO学习基础之读写文本文件
- Java IO学习基础之读写文本文件
- quartz定时任务调度学习
- WIN7中修改Jar文件打开方式的方法
- EPO技术
- Java 定时关机程序
- Google Maps API开发样例一则
- Silverlight独立存储之读写文本文件
- JAVA 创建TXT文件,写入文件内容,读取文件内容
- 【总结】SAE下thinkphp的cookie
- 大数相乘——自己仿写版
- listener静态注册和动态注册总结
- MD5加密(输出后为大写字母)
- Iphone开发(十二)通过xib文件自定义列表中的行
- Unable to open kernel device "\\.\vmci"
- 字符串反转