TargetParameterCountException 建構函式

定義

初始化 TargetParameterCountException 類別的新執行個體。

多載

TargetParameterCountException()

使用空訊息字串和例外狀況的根本原因,來初始化 TargetParameterCountException 類別的新執行個體。

TargetParameterCountException(String)

使用其訊息字串設為指定的訊息和根本原因例外狀況,來初始化 TargetParameterCountException 類別的新執行個體。

TargetParameterCountException(String, Exception)

使用指定的錯誤訊息以及造成此例外狀況的內部例外狀況的參考,初始化 TargetParameterCountException 類別的新執行個體。

TargetParameterCountException()

來源:
TargetParameterCountException.cs
來源:
TargetParameterCountException.cs
來源:
TargetParameterCountException.cs

使用空訊息字串和例外狀況的根本原因,來初始化 TargetParameterCountException 類別的新執行個體。

public:
 TargetParameterCountException();
public TargetParameterCountException ();
Public Sub New ()

備註

TargetParameterCountException 繼承自 Exception。 此建構函式會設定 Exception 物件的屬性,如下表所示。

屬性
InnerException null
Message 空字串 (“”) 。

適用於

TargetParameterCountException(String)

來源:
TargetParameterCountException.cs
來源:
TargetParameterCountException.cs
來源:
TargetParameterCountException.cs

使用其訊息字串設為指定的訊息和根本原因例外狀況,來初始化 TargetParameterCountException 類別的新執行個體。

public:
 TargetParameterCountException(System::String ^ message);
public TargetParameterCountException (string message);
public TargetParameterCountException (string? message);
new System.Reflection.TargetParameterCountException : string -> System.Reflection.TargetParameterCountException
Public Sub New (message As String)

參數

message
String

String,描述這個例外狀況擲回的原因。

備註

TargetParameterCountException 繼承自 Exception。 此建構函式會設定 物件的屬性 Exception ,如下表所示。

屬性
InnerException null
Message 訊息字串。

適用於

TargetParameterCountException(String, Exception)

來源:
TargetParameterCountException.cs
來源:
TargetParameterCountException.cs
來源:
TargetParameterCountException.cs

使用指定的錯誤訊息以及造成此例外狀況的內部例外狀況的參考,初始化 TargetParameterCountException 類別的新執行個體。

public:
 TargetParameterCountException(System::String ^ message, Exception ^ inner);
public TargetParameterCountException (string message, Exception inner);
public TargetParameterCountException (string? message, Exception? inner);
new System.Reflection.TargetParameterCountException : string * Exception -> System.Reflection.TargetParameterCountException
Public Sub New (message As String, inner As Exception)

參數

message
String

解釋例外狀況原因的錯誤訊息。

inner
Exception

做為目前例外狀況發生原因的例外狀況。 如果 inner 參數不是 null,則目前的例外狀況會在處理內部例外的 catch 區塊中引發。

備註

被擲回以做為前一個例外狀況直接結果的例外狀況,應該在 InnerException 屬性中包含對前一個例外狀況的參考。 InnerException 屬性傳回的值會與傳入建構函式的值相同,或傳回 null (如果 InnerException 屬性未提供內部例外狀況值給建構函式)。

下表顯示 TargetParameterCountException 執行個體的初始屬性值。

屬性
InnerException 內部例外狀況參考。
Message 錯誤訊息字串。

另請參閱

適用於