首页 > 代码库 > C#Winform屏蔽错误窗弹出

C#Winform屏蔽错误窗弹出

 

   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);

  

C#Winform屏蔽错误窗弹出