ASP. NET forums2.x automatically captures the exception base class

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.