引用
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
m isoStore=new IsolatedStorageFileStrea
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
m isoStore=new IsolatedStorageFileStrea
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();
}
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){
}