[求助]怎样把文本框中的文本写入到一个文件中去?
string s = this.txt_File.Text.Trim(); //要写入的文本string PathFile = this.txt_FileName.Text.Trim() ; //文件路径(如:D:\aa.txt)
Stream fw = File.Open(PathFile,FileMode.CreateNew,FileAccess.Write);
byte[] w = new byte[s.Length];
int bWrite = int.Parse(s.Length.ToString());
int bsWrite = 0;
while(bsWrite == bWrite)
{
fw.Write(w,bsWrite,bWrite);
bsWrite ++;
}
fw.Close();