编码方式 FileStream fs = new FileStream("D:\\text.txt", FileMode.Append);StreamWriter sw = new StreamWriter(fs,Encoding.Defaut);sw.WriteLine("Hello");//最后记得关闭sw.Close();fs.Close();
用完许关闭流,加sw.Close();
sw.Flush();