How to create global error handler in Windows Form Application?

前端 未结 3 1086
醉梦人生
醉梦人生 2021-02-09 15:09

I think there was a component that allowed to create global error handling.

For example I myself throw exception when something bad happens, for example

         


        
3条回答
  •  無奈伤痛
    2021-02-09 15:43

    To Handle Exceptions Globally...

    Windows Application

    System.Windows.Forms.Application.ThreadException event

    Generally Used in Main Method. Refer MSDN Thread Exception

    Asp.Net

    System.Web.HttpApplication.Error event

    Normally Used in Global.asax file. Refer MSDN Global.asax Global Handlers

    Console Application

    System.AppDomain.UnhandledException event

    Generally used in Main Method. Refer MSDN UnhandledException

提交回复
热议问题