
如果
#26是异常,则可以使用
AppDomain.CurrentDomain.UnhandledException事件。如果这只是一个返回值,那么我看不到有任何全局处理该值的机会。
public static void Main(){ AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(MyHandler); // start main thread here}static void MyHandler(object sender, UnhandledExceptionEventArgs args) { Exception e = (Exception) args.ExceptionObject; Console.WriteLine("MyHandler caught : " + e.Message);}欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)