static void Application_ThreadException(object sender, System.Threading.ThreadExceptionEventArgs e) { } static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) { }
Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException); //处理UI线程异常 Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException); //处理非UI线程异常 AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
时间: 2024-10-12 19:42:30