CodeCatchClause 建構函式

定義

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

多載

CodeCatchClause()

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

CodeCatchClause(String)

使用例外狀況的指定區域變數名稱,初始化 CodeCatchClause 類別的新執行個體。

CodeCatchClause(String, CodeTypeReference)

使用例外狀況和例外狀況型別的指定區域變數名稱,初始化 CodeCatchClause 類別的新執行個體。

CodeCatchClause(String, CodeTypeReference, CodeStatement[])

使用例外狀況、例外狀況型別和陳述式 (Statement) 集合的指定區域變數名稱,初始化 CodeCatchClause 類別的新執行個體。

CodeCatchClause()

來源:
CodeCatchClause.cs
來源:
CodeCatchClause.cs
來源:
CodeCatchClause.cs

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

C#
public CodeCatchClause ();

適用於

.NET Framework 4.8.1 和其他版本
產品 版本
.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, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

CodeCatchClause(String)

來源:
CodeCatchClause.cs
來源:
CodeCatchClause.cs
來源:
CodeCatchClause.cs

使用例外狀況的指定區域變數名稱,初始化 CodeCatchClause 類別的新執行個體。

C#
public CodeCatchClause (string localName);

參數

localName
String

針對例外狀況,宣告於 Catch 子句的區域變數名稱。 這是選擇性的。

另請參閱

適用於

.NET Framework 4.8.1 和其他版本
產品 版本
.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, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

CodeCatchClause(String, CodeTypeReference)

來源:
CodeCatchClause.cs
來源:
CodeCatchClause.cs
來源:
CodeCatchClause.cs

使用例外狀況和例外狀況型別的指定區域變數名稱,初始化 CodeCatchClause 類別的新執行個體。

C#
public CodeCatchClause (string localName, System.CodeDom.CodeTypeReference catchExceptionType);

參數

localName
String

針對例外狀況,宣告於 Catch 子句的區域變數名稱。 這是選擇性的。

catchExceptionType
CodeTypeReference

CodeTypeReference,表示要攔截的例外狀況型別。

適用於

.NET Framework 4.8.1 和其他版本
產品 版本
.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, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

CodeCatchClause(String, CodeTypeReference, CodeStatement[])

來源:
CodeCatchClause.cs
來源:
CodeCatchClause.cs
來源:
CodeCatchClause.cs

使用例外狀況、例外狀況型別和陳述式 (Statement) 集合的指定區域變數名稱,初始化 CodeCatchClause 類別的新執行個體。

C#
public CodeCatchClause (string localName, System.CodeDom.CodeTypeReference catchExceptionType, params System.CodeDom.CodeStatement[] statements);

參數

localName
String

針對例外狀況,宣告於 Catch 子句的區域變數名稱。 這是選擇性的。

catchExceptionType
CodeTypeReference

CodeTypeReference,表示要攔截的例外狀況型別。

statements
CodeStatement[]

CodeStatement 物件的陣列,表示攔截區塊的內容。

適用於

.NET Framework 4.8.1 和其他版本
產品 版本
.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, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9