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();
        }
    }
}

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-06-24
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-10
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-11
  • 2022-12-23
相关资源
相似解决方案