[英]Handle exceptions in AppDomain.CurrentDomain.UnhandledException
Is it possible to handle exceptions on the AppDomain.CurrentDomain.UnhandledException callback? 是否可以在AppDomain.CurrentDomain.UnhandledException回调上处理异常? I want to do the following:
我想做以下事情:
Can this be done? 可以这样做吗?
You could to use Application.SetUnhandledExceptionMode
method. 您可以使用
Application.SetUnhandledExceptionMode
方法。
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 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. 如代码所示,只需听取异常并在发生时执行您想要的操作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.