全球的WinForms异常处理? [英] WinForms Global Exception Handling?
本文介绍了全球的WinForms异常处理?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已经实现其中有一个包含庞大的组类,其中包括所有我的软件的方法的DLL库的软件。
I have implemented a software which have a DLL library which contains a huge set of classes which includes all the methods for my software.
现在我希望能够处理类似的错误#26是所有这些类,而不是要每一个类,并将其添加一个没有网络相关的错误一些全球性的错误。那怎么办?
Now i want to be able to handle some global errors like error #26 which is a no Network Related Error on all these classes instead of going to each class and add it. How to do that ?
推荐答案
I #26
是个例外,那么你可以使用 AppDomain.CurrentDomain。 UnhandledException
事件。如果它只是一个返回值,那么我不会任何机会来处理,全球。
I #26
is an exception then you can use AppDomain.CurrentDomain.UnhandledException
event. If it's just a return value, then I won't any chance to handle that globally.
这篇关于全球的WinForms异常处理?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文