第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

WPF 捕獲所有異常

WPF 捕獲所有異常

C#
回首憶惘然 2021-06-24 14:02:57
我試圖在我的 WPF 應(yīng)用程序中捕獲所有異常。我嘗試了以下代碼但它不起作用我不知道為什么?<Application x:Class="DBFilter.App"         xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"         StartupUri="MainWindow.xaml"         Exit="Application_Exit"                        DispatcherUnhandledException ="AppDispatcherUnhandledException"         ><Application.Resources>     </Application.Resources></Application>應(yīng)用程序.xaml.csprotected override void OnStartup(StartupEventArgs e)    {        AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(AppDomainUnhandledExceptionHandler);        System.Windows.Forms.Application.ThreadException += new ThreadExceptionEventHandler(Application_ThreadException);        Application.Current.DispatcherUnhandledException += new DispatcherUnhandledExceptionEventHandler(AppDispatcherUnhandledException);}void AppDomainUnhandledExceptionHandler(object sender, UnhandledExceptionEventArgs ex)    {        Exception ex = (Exception)ea.ExceptionObject;     MessageBox.Show(ex.Exception.InnerException.Message);        }void Application_ThreadException(object sender, ThreadExceptionEventArgs e)    {        MessageBox.Show(e.Exception.InnerException.Message);    }                       void AppDispatcherUnhandledException(object sender,DispatcherUnhandledExceptionEventArgs e)    {        MessageBox.Show(e.Exception.InnerException.Message);    }稍后,我會(huì)將所有異常寫(xiě)入日志表。
查看完整描述

1 回答

  • 1 回答
  • 0 關(guān)注
  • 174 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)