/// <summary>
/// 记录错误日志
/// </summary>
/// <param name="inErrorMsg">错误内容</param>
private void Error(string inErrorMsg)
{
string logDirectory = Server.MapPath("~\log");
if (!Directory.Exists(logDirectory))
Directory.CreateDirectory(logDirectory);
System.IO.File.AppendAllText(
string.Format(logDirectory + "\ErrorLog{0}.txt", DateTime.Now.ToString("yyyyMMdd")),
DateTime.Now.ToString("(yyyy-MM-dd HH:mm:ss):") + inErrorMsg + "
==============================================
");
}
Error(ex.Message);