StackOverflowException 建構函式

定義

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

多載

StackOverflowException()

初始化 StackOverflowException 類別的新執行個體,設定新執行個體的 Message 屬性為描述錯誤的系統提供訊息,例如「要求的作業造成堆疊溢位」。 此訊息會考慮到目前系統的文化特性。

StackOverflowException(String)

使用指定的錯誤訊息,初始化 StackOverflowException 類別的新執行個體。

StackOverflowException(String, Exception)

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

StackOverflowException()

初始化 StackOverflowException 類別的新執行個體,設定新執行個體的 Message 屬性為描述錯誤的系統提供訊息,例如「要求的作業造成堆疊溢位」。 此訊息會考慮到目前系統的文化特性。

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

備註

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

屬性
InnerException null.
Message 當地語系化的錯誤訊息字串。

適用於

StackOverflowException(String)

使用指定的錯誤訊息,初始化 StackOverflowException 類別的新執行個體。

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

參數

message
String

描述錯誤的 String。 訊息的內容必須能讓人瞭解。 需要此建構函式的呼叫者,才能確保此字串已針對目前的系統文化特性進行當地語系化。

備註

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

屬性
InnerException null 參考 (在 Visual Basic 中為 Nothing)。
Message 錯誤訊息字串。

適用於

StackOverflowException(String, Exception)

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

public:
 StackOverflowException(System::String ^ message, Exception ^ innerException);
public StackOverflowException (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 參考 (在 Visual Basic 中為 Nothing),則會在處理內部例外的 catch 區塊中引發目前的例外狀況。

備註

直接因為前一個例外狀況而擲回的例外狀況可能包含對 InnerException 屬性中前一個例外狀況的參考。 InnerException 屬性會傳回與傳入建構函式中相同的值;如果 Nothing 屬性不提供內部例外值給建構函式,則傳回 null 參考 (在 Visual Basic 中為 InnerException)。

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

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

另請參閱

適用於