StackOverflowException 构造函数
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
初始化 StackOverflowException 类的新实例。
重载
| 名称 | 说明 |
|---|---|
| StackOverflowException() |
初始化 StackOverflowException 类的新实例,将新实例的 Message 属性设置为系统提供的消息,该消息描述错误,例如“请求的操作导致堆栈溢出”。此消息将考虑当前系统区域性。 |
| StackOverflowException(String) |
使用指定的错误消息初始化类的新实例 StackOverflowException 。 |
| StackOverflowException(String, Exception) |
使用指定的错误消息和对作为此异常原因的内部异常的引用初始化 StackOverflowException 类的新实例。 |
StackOverflowException()
初始化 StackOverflowException 类的新实例,将新实例的 Message 属性设置为系统提供的消息,该消息描述错误,例如“请求的操作导致堆栈溢出”。此消息将考虑当前系统区域性。
public:
StackOverflowException();
public StackOverflowException();
Public Sub New ()
注解
下表显示了 StackOverflowException实例的初始属性值。
| 财产 | Value |
|---|---|
| InnerException |
null。 |
| Message | 本地化的错误消息字符串。 |
适用于
StackOverflowException(String)
使用指定的错误消息初始化类的新实例 StackOverflowException 。
public:
StackOverflowException(System::String ^ message);
public StackOverflowException(string message);
new StackOverflowException : string -> StackOverflowException
Public Sub New (message As String)
参数
注解
下表显示了 StackOverflowException实例的初始属性值。
| 财产 | Value |
|---|---|
| InnerException | Null 引用(Nothing 在 Visual Basic 中)。 |
| Message | 错误消息字符串。 |
适用于
StackOverflowException(String, Exception)
使用指定的错误消息和对作为此异常原因的内部异常的引用初始化 StackOverflowException 类的新实例。
public:
StackOverflowException(System::String ^ message, Exception ^ innerException);
public StackOverflowException(string message, Exception innerException);
new StackOverflowException : string * Exception -> StackOverflowException
Public Sub New (message As String, innerException As Exception)
参数
- message
- String
解释异常原因的错误消息。
- innerException
- Exception
是当前异常原因的异常。
innerException如果参数不是 null 引用(Nothing在 Visual Basic 中),则当前异常在处理内部异常的块中catch引发。
注解
作为上一个异常的直接结果引发的异常可以包含对属性中上一个异常的 InnerException 引用。 如果InnerException属性未向构造函数提供内部异常值,则该Nothing属性将返回传递给构造函数的相同值,或返回 null 引用(InnerException在 Visual Basic 中)。
下表显示了 StackOverflowException实例的初始属性值。
| 财产 | Value |
|---|---|
| InnerException | 内部异常引用。 |
| Message | 错误消息字符串。 |