使用Application_Error事件处理程序把异常记录到系统事件日志

 

using System.Diagnostics

protected void Application_Error(Object sender, EventArgs e)

        {

            EventLog.WriteEntry("FriendsReunion",

                Server.GetLastError().InnerException.Message,

                EventLogEntryType.Error);

        }

posted @ 2005-06-11 13:37  虚空境界  Views(971)  Comments(0)    收藏  举报