标签:reading event present tar app ace mic 处理 ica
wpf程序
在App.xaml中增加如下代码
1 DispatcherUnhandledException="Application_DispatcherUnhandledException"
完成代码如下:
<Application x:Class="WpfApp1.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:WpfApp1" StartupUri="MainWindow.xaml" DispatcherUnhandledException="Application_DispatcherUnhandledException"> <Application.Resources> </Application.Resources> </Application>
在App.xaml.cs中增加如下代码
1 public partial class App : Application 2 { 3 private void Application_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e) 4 { 5 //全局程序异常处理 6 MessageBox.Show("提示程序中出现了严重错误,请联系软件开发商"+e.Exception.Message); 7 e.Handled = true; 8 } 9 }
标签:reading event present tar app ace mic 处理 ica
原文地址:http://www.cnblogs.com/dylanhu/p/7953562.html