wpf 程序异常捕获,而不崩溃退出


        public App()
        {
            DispatcherUnhandledException += App_DispatcherUnhandledException;
        }

        void App_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e)
        {
            MessageBox.Show("程序异常." + Environment.NewLine + e.Exception.Message);
            //Shutdown(1);
            e.Handled = true;
        }



http://www.cnblogs.com/DebugLZQ/p/3161185.html



你可能感兴趣的:(.net)