閱讀英文

共用方式為


UnhandledExceptionEventHandler 代理人

定義

表示將處理例外狀況所引發之事件的方法,而該例外狀況不是由應用程式定義域處理。

C#
public delegate void UnhandledExceptionEventHandler(object sender, UnhandledExceptionEventArgs e);
C#
[System.Serializable]
public delegate void UnhandledExceptionEventHandler(object sender, UnhandledExceptionEventArgs e);
C#
[System.Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
public delegate void UnhandledExceptionEventHandler(object sender, UnhandledExceptionEventArgs e);

參數

sender
Object

未處理的例外狀況事件來源。

e
UnhandledExceptionEventArgs

包含事件資料的 UnhandledExceptionEventArgs

屬性

備註

UnhandledExceptionEventHandler只能針對系統所建立的預設應用程式域指定 ,以執行應用程式。 為 UnhandledExceptionEventHandler 應用程式所建立的 AppDomain 指定 沒有作用。

當您建立 UnhandledExceptionEventHandler 委派 (Delegate) 時,就可以識別即將處理此事件的方法。 若要將事件處理常式與您的事件產生關聯,請將委派的實例新增至 事件。 除非您移除委派,否則每當事件發生時就會呼叫事件處理常式。 如需事件處理常式委派的詳細資訊,請參閱 處理和引發事件

擴充方法

GetMethodInfo(Delegate)

取得表示特定委派所代表之方法的物件。

適用於

產品 版本
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8
.NET Standard 2.0, 2.1

另請參閱