private void Page_Error(object sender, EventArgs e)
{
string errMsg;
Exception currentError = Server.GetLastError();
errMsg = "<link rel=\"stylesheet\" href=\"";
errMsg += Application["vRoot"];
errMsg += "/Style.css\">";
errMsg += "<h1>弈天广告联盟系统:页面错误</h1><hr/>此页面发生一个以外错误,对此我们表示非常抱歉." +
"此错误消息已经通知管理员,请及时和我们联系,我们会及时解决此问题!<br/>" +
"错误位置:" + Request.Url.ToString() + "<br/>" +
"错误消息:<font class=\"ErrorMessage\">" + currentError.Message.ToString() + "</font</hr>" +
"<b>Stack Trace:</b><br/>" +
currentError.ToString();
//如果发生致命错误
//if(!(currentError is ApplicationException))
//{
//向Windows日志中写入错误日志
//LogEvent(currentError.ToString(),EventLogEntryType.Error);
//}
Response.Write(errMsg);
//清除错误
Server.ClearError();
}
{
string errMsg;
Exception currentError = Server.GetLastError();
errMsg = "<link rel=\"stylesheet\" href=\"";
errMsg += Application["vRoot"];
errMsg += "/Style.css\">";
errMsg += "<h1>弈天广告联盟系统:页面错误</h1><hr/>此页面发生一个以外错误,对此我们表示非常抱歉." +
"此错误消息已经通知管理员,请及时和我们联系,我们会及时解决此问题!<br/>" +
"错误位置:" + Request.Url.ToString() + "<br/>" +
"错误消息:<font class=\"ErrorMessage\">" + currentError.Message.ToString() + "</font</hr>" +
"<b>Stack Trace:</b><br/>" +
currentError.ToString();
//如果发生致命错误
//if(!(currentError is ApplicationException))
//{
//向Windows日志中写入错误日志
//LogEvent(currentError.ToString(),EventLogEntryType.Error);
//}
Response.Write(errMsg);
//清除错误
Server.ClearError();
}