InsufficientMemoryException 建構函式

定義

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

多載

InsufficientMemoryException()

使用系統提供的錯誤描述訊息,初始化 InsufficientMemoryException 類別的新執行個體。

InsufficientMemoryException(String)

初始化具有指定的錯誤描述訊息之 InsufficientMemoryException 類別的新執行個體。

InsufficientMemoryException(String, Exception)

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

InsufficientMemoryException()

使用系統提供的錯誤描述訊息,初始化 InsufficientMemoryException 類別的新執行個體。

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

備註

這個建構函式會將新實例的 屬性初始化 Message 為系統提供的訊息,以描述錯誤,例如「目前沒有足夠的可用記憶體來滿足作業的預期需求。 請稍後再試。」 此訊息會考慮到目前系統的文化特性。

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

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

另請參閱

適用於

InsufficientMemoryException(String)

初始化具有指定的錯誤描述訊息之 InsufficientMemoryException 類別的新執行個體。

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

參數

message
String

說明例外狀況的訊息。 需要此建構函式的呼叫者,才能確保此字串已針對目前的系統文化特性進行當地語系化。

備註

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

屬性
InnerException null.
Message message 中指定的錯誤訊息字串。

另請參閱

適用於

InsufficientMemoryException(String, Exception)

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

public:
 InsufficientMemoryException(System::String ^ message, Exception ^ innerException);
public InsufficientMemoryException (string? message, Exception? innerException);
public InsufficientMemoryException (string message, Exception innerException);
new InsufficientMemoryException : string * Exception -> InsufficientMemoryException
Public Sub New (message As String, innerException As Exception)

參數

message
String

說明例外狀況的訊息。 需要此建構函式的呼叫者,才能確保此字串已針對目前的系統文化特性進行當地語系化。

innerException
Exception

做為目前例外狀況發生原因的例外狀況。 如果 innerException 參數不是 null,則目前的例外狀況會在處理內部例外的 catch 區塊中引發。

備註

被擲回以做為前一個例外狀況直接結果的例外狀況,應該在 InnerException 屬性中包含對前一個例外狀況的參考。 InnerException 屬性傳回的值會與傳入建構函式的值相同,或傳回 null (如果 InnerException 屬性未提供內部例外狀況值給建構函式)。

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

屬性
InnerException null.
Message message 中指定的錯誤訊息字串。

另請參閱

適用於