常用Common集合
Log
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
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()); } } } }