使用Application_Error事件处理程序把异常记录到系统事件日志
using System.Diagnostics
protected void Application_Error(Object sender, EventArgs e)
{
EventLog.WriteEntry("FriendsReunion",
Server.GetLastError().InnerException.Message,
EventLogEntryType.Error);
}

浙公网安备 33010602011771号