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

来源:互联网 发布:巨人网络招聘2017 编辑:程序博客网 时间:2024/05/02 01:36


        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



0 0
原创粉丝点击