/// <summary>
        /// 向txt文件中写入信息
        /// </summary>
        /// <param name="filePath"></param>
        /// <param name="massage"></param>
        public static void WriteTxt(string filePath, string massage)
        {
            FileStream fs1;

            //判断是否已经有了这个文件
            if (!File.Exists(filePath))
            {
                //没有则创建这个文件
                fs1 = new FileStream(filePath, FileMode.Create);//创建写入文件   
            }


            using (StreamWriter sw = File.AppendText(filePath))
            {
                sw.WriteLine(massage);
            }



        }

 

相关文章:

  • 2023-01-25
  • 2021-07-01
  • 2022-12-23
  • 2022-12-23
  • 2021-08-03
  • 2021-08-10
  • 2021-04-17
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-08-08
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案