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(); } } }
C#-创建并添加TXT文件
猜你喜欢
转载自www.cnblogs.com/zhyue93/p/CSharp_Text.html
今日推荐
周排行