常用Common集合

Log
using System;
using System.IO;
using System.Linq;
using System.Text;

namespace Common
{
    public class Log
    {
        public static void Writer(Exception ex, string title)
        {
            using (StreamWriter sw = new StreamWriter(AppDomain.CurrentDomain.BaseDirectory + "\\log.txt", true))
            {
                sw.WriteLine("============时间:" + DateTime.Now.ToString() + "=======================");
                sw.WriteLine("========================" + title + "===============================");
                sw.WriteLine("异常信息:" + ex.ToString());
            }
        }
    }
}
View Code

 

posted @ 2016-11-15 16:38  -Ward-  阅读(207)  评论(0编辑  收藏  举报