StackOverflowException StackOverflowException StackOverflowException StackOverflowException Constructors

定义

重载

StackOverflowException() StackOverflowException() StackOverflowException()

初始化 StackOverflowException 类的新实例,将新实例的 Message 属性设置为系统提供的描述错误的消息,如“所请求的操作导致堆栈溢出”。Initializes a new instance of the StackOverflowException class, setting the Message property of the new instance to a system-supplied message that describes the error, such as "The requested operation caused a stack overflow." 此消息将当前系统区域性考虑在内。This message takes into account the current system culture.

StackOverflowException(String) StackOverflowException(String) StackOverflowException(String) StackOverflowException(String)

用指定的错误消息初始化 StackOverflowException 类的新实例。Initializes a new instance of the StackOverflowException class with a specified error message.

StackOverflowException(String, Exception) StackOverflowException(String, Exception) StackOverflowException(String, Exception) StackOverflowException(String, Exception)

使用指定的错误消息和对作为此异常原因的内部异常的引用来初始化 StackOverflowException 类的新实例。Initializes a new instance of the StackOverflowException class with a specified error message and a reference to the inner exception that is the cause of this exception.

StackOverflowException() StackOverflowException() StackOverflowException()

初始化 StackOverflowException 类的新实例,将新实例的 Message 属性设置为系统提供的描述错误的消息,如“所请求的操作导致堆栈溢出”。Initializes a new instance of the StackOverflowException class, setting the Message property of the new instance to a system-supplied message that describes the error, such as "The requested operation caused a stack overflow." 此消息将当前系统区域性考虑在内。This message takes into account the current system culture.

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

注解

下表显示 StackOverflowException 的实例的初始属性值。The following table shows the initial property values for an instance of StackOverflowException.

PropertyProperty Value
InnerException nullnull.
Message 本地化的错误消息字符串。The localized error message string.

StackOverflowException(String) StackOverflowException(String) StackOverflowException(String) StackOverflowException(String)

用指定的错误消息初始化 StackOverflowException 类的新实例。Initializes a new instance of the StackOverflowException class with a specified error message.

public:
 StackOverflowException(System::String ^ message);
public StackOverflowException (string message);
new StackOverflowException : string -> StackOverflowException
Public Sub New (message As String)

参数

message
String String String String

描述该错误的 StringA String that describes the error. message 的内容被设计为人可理解的形式。The content of message is intended to be understood by humans. 此构造函数的调用方需要确保此字符串已针对当前系统区域性进行了本地化。The caller of this constructor is required to ensure that this string has been localized for the current system culture.

注解

下表显示 StackOverflowException 的实例的初始属性值。The following table shows the initial property values for an instance of StackOverflowException.

PropertyProperty “值”Value
InnerException 空引用(在 Visual Basic 中为 Nothing)。A null reference (Nothing in Visual Basic).
Message 错误消息字符串。The error message string.

StackOverflowException(String, Exception) StackOverflowException(String, Exception) StackOverflowException(String, Exception) StackOverflowException(String, Exception)

使用指定的错误消息和对作为此异常原因的内部异常的引用来初始化 StackOverflowException 类的新实例。Initializes a new instance of the StackOverflowException class with a specified error message and a reference to the inner exception that is the cause of this exception.

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 String String String

解释异常原因的错误消息。The error message that explains the reason for the exception.

innerException
Exception Exception Exception Exception

导致当前异常的异常。The exception that is the cause of the current exception. 如果 innerException 参数不是 null 引用(在 Visual Basic 中为 Nothing),则在处理内部异常的 catch 块中引发当前异常。If the innerException parameter is not a null reference (Nothing in Visual Basic), the current exception is raised in a catch block that handles the inner exception.

注解

因前一个异常而直接引发的异常可以在 InnerException 属性中包含对前一个异常的引用。An exception that is thrown as a direct result of a previous exception can include a reference to the previous exception in the InnerException property. InnerException 属性返回传递到构造函数中的相同值,或者如果 Nothing 属性不向构造函数提供内部异常值,则为空引用(在 Visual Basic 中为 InnerException)。The InnerException property returns the same value that is passed into the constructor, or a null reference (Nothing in Visual Basic) if the InnerException property does not supply the inner exception value to the constructor.

下表显示 StackOverflowException 的实例的初始属性值。The following table shows the initial property values for an instance of StackOverflowException.

PropertyProperty “值”Value
InnerException 内部异常引用。The inner exception reference.
Message 错误消息字符串。The error message string.
另请参阅

适用于