From: http://www.cnblogs.com/ynlxc/archive/2005/07/11/190397.html
A small feature that automatically captures system exceptions must be implemented for the first time due to project needs (convenientProgramPersonnel maintenance), query the onlineNMulti-data, final discoveryASP. NET forums 2.xIf the exception is handled wellCodeSeparated and shared with you.
The above is the core code for exception handling: InheritanceIhttpmoduleInterface. When a system error occurs, it automatically captures the exception information and records it to the system.
The following is the call process:
System Error
>>>
Private VoidApplication_onerror (Object source, eventargs e ){}
>>>
Forumexception. Log ();
>>>
Public Override VoidLogexception (forumexception exception ){}This method finally calls a stored procedure to insert relevant exception information into the database.
The younger brother posted something on the internet for the first time. Do not launch personal attacks if anything is inappropriate :)
Appendix: DemoDemoOne (including source code)
Www.qjtf.cn//ftproot/ljn/demo/test.rar