先执行的代码如下
private void Form1_Load(object sender, System.EventArgs e)
{ string input="";
FileInfo f=new FileInfo(".\\info.txt");
try
{

if(f.Exists)
{
FileStream fs=new FileStream(".\\info.txt",FileMode.OpenOrCreate);
StreamReader sr=new StreamReader(fs,System.Text.Encoding.Default);


while((input=sr.ReadLine())!=null)
{

this.Text=input;

}
fs.Flush();
sr.Close();
fs.Close();


}
}
catch(Exception ee)
{
MessageBox.Show(ee.Message.ToString());
 }
后执行的代码如下:
FileStream fs=new FileStream(".\\info.txt",FileMode.OpenOrCreate);

string input=textBox1.Text.ToString().Trim();
StreamWriter sw=new StreamWriter(".\\info.txt");
sw.Write(input);
sw.Flush();
fs.Flush();
sw.Close();
fs.Close();
结果不能写入 提示 该文件正由另一进程使用
我read 那里 已经 结束 
fs.Flush();
sr.Close();
fs.Close();
高手 指教啊