C#-创建并添加TXT文件
public static void WriteToText(string txtContent, string txtPath) { using (FileStream fs = new FileStream(txtPath, FileMode.OpenOrCreate,FileAccess.Write)) { using (StreamWriter sw=new StreamWriter(fs)) { sw.BaseStream.Seek(0, SeekOrigin.End); sw.WriteLine("{0}\n", txtContent); sw.Flush(); } } }