string path=@"E:\我的文本.txt";
string text=this.textBox1.text.Trim(); //接收
FileStream fs=null;
try
{
fs=new FileStream(path,FileMode.Create,FileAccess.Write);
StreamWrite sw=new StreamWrite(fs,Encoding.UTF8);
sw.Write(text);
sw.Close();
}
catch
{
}
finally
{
fs.Close();
}
文件读写啊,streamWrite对象