TargetParameterCountException 构造函数
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
初始化 TargetParameterCountException 类的新实例。
重载
| 名称 | 说明 |
|---|---|
| TargetParameterCountException() |
使用空消息字符串和异常的根本原因初始化类的新实例 TargetParameterCountException 。 |
| TargetParameterCountException(String) |
初始化类的新实例 TargetParameterCountException ,其消息字符串设置为给定消息和根本原因异常。 |
| TargetParameterCountException(String, Exception) |
使用指定的错误消息和对作为此异常原因的内部异常的引用初始化类的新实例 TargetParameterCountException 。 |
TargetParameterCountException()
使用空消息字符串和异常的根本原因初始化类的新实例 TargetParameterCountException 。
public:
TargetParameterCountException();
public TargetParameterCountException();
Public Sub New ()
注解
TargetParameterCountException 继承自 Exception. 此构造函数设置 Exception 对象的属性,如下表所示。
| 财产 | 价值 |
|---|---|
| InnerException | null |
| Message | 空字符串(“)。 |
适用于
TargetParameterCountException(String)
初始化类的新实例 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 | message 字符串。 |
适用于
TargetParameterCountException(String, Exception)
使用指定的错误消息和对作为此异常原因的内部异常的引用初始化类的新实例 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 | 错误消息字符串。 |