silverlight   发布时间:2022-05-04  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了Silverlight独立存储之读写文本文件大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

概述

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

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("缺少输入信息");
}
IsolatedStorageFileStrea @H_544_31@m isoStore=new IsolatedStorageFileStrea @H_544_31@m("myinfo.txt",FileMode.Create,IsolatedStorageFile.GetUserStoreForApplicati on());
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.GetUserStoreForApplicati on().FileExists("myinfo.txt")){
messageBox.Show("没有可用的独立存储文件!");
}
IsolatedStorageFileStrea @H_544_31@m isoStore=new IsolatedStorageFileStrea @H_544_31@m("myinfo.txt",FileMode.open,IsolatedStorageFile.GetUserStoreForApplicati on());
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

大佬总结

以上是大佬教程为你收集整理的Silverlight独立存储之读写文本文件全部内容,希望文章能够帮你解决Silverlight独立存储之读写文本文件所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。