麦田

不积跬步无以至千里.

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::
    public static class StringHelper
    {
        public static void ToLog(this string content,string txtName)
        {
            string filePath = System.Environment.CurrentDirectory + $"\\{txtName}.txt";
            if (!System.IO.File.Exists(filePath))
            {
                System.IO.File.Create(filePath).Dispose();
            }
            System.IO.File.AppendAllLines(filePath,new string[] { content });
        }
    }

 

posted on 2025-04-12 09:26  一些记录  阅读(10)  评论(0)    收藏  举报