C# 存储日志

 存储日志

 public void log(string neirong)
        {
            var path = @"D:\xx文件名xx\Log\" + "日志" + ".log";
            using (StreamWriter st = new StreamWriter(path, append: true))
            {
                st.WriteLine( "  " + DateTime.Now + "  " + neirong);
            }
        }

 

posted @ 2020-03-05 13:40  Chen0110  阅读(502)  评论(1编辑  收藏  举报