开发者

Handle exceptions in AppDomain.CurrentDomain.UnhandledException

Is it possible to handle exceptions on the AppDomain.CurrentDomain.UnhandledException callback? I want to do the following:

  • Show my own "an exception has occured" dialog, with a "Send Report" button
  • After the user dismissed the box, I want to close my app, but I do not want 开发者_运维问答to Windows default crash dialog "The application needs to close" box to show up.

Can this be done?


You could to use Application.SetUnhandledExceptionMode method.

Please, take also a look here: User Friendly Exception Handling.


Hope this link helps:

http://www.switchonthecode.com/tutorials/csharp-tutorial-dealing-with-unhandled-exceptions

As the code shows, just listen to the exception and do what you want when it happens.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜