InsufficientMemoryException 构造函数

定义

初始化 InsufficientMemoryException 类的新实例。Initializes a new instance of the InsufficientMemoryException class.

重载

InsufficientMemoryException()

使用由系统提供的用于描述错误的消息初始化 InsufficientMemoryException 类的新实例。Initializes a new instance of the InsufficientMemoryException class with a system-supplied message that describes the error.

InsufficientMemoryException(String)

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

InsufficientMemoryException(String, Exception)

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

InsufficientMemoryException()

使用由系统提供的用于描述错误的消息初始化 InsufficientMemoryException 类的新实例。Initializes a new instance of the InsufficientMemoryException class with a system-supplied message that describes the error.

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

注解

此构造函数将新实例的 Message 属性初始化为系统提供的描述错误的消息,如 "目前没有足够的可用内存来满足操作的预期要求。This constructor initializes the Message property of the new instance to a system-supplied message that describes the error, such as "Insufficient available memory to meet the expected demands of an operation at this time. 请稍后重试。 "Please try again later." 此消息会考虑当前系统区域性。This message takes into account the current system culture.

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

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

另请参阅

InsufficientMemoryException(String)

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

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

参数

message
String

描述异常的消息。The message that describes the exception. 此构造函数的调用方需要确保此字符串已针对当前系统区域性进行了本地化。The caller of this constructor is required to ensure that this string has been localized for the current system culture.

注解

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

属性Property Value
InnerException nullnull.
Message message 中指定的错误消息字符串。The error message string specified in message.

另请参阅

InsufficientMemoryException(String, Exception)

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

public:
 InsufficientMemoryException(System::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

描述异常的消息。The message that describes the exception. 此构造函数的调用方需要确保此字符串已针对当前系统区域性进行了本地化。The caller of this constructor is required to ensure that this string has been localized for the current system culture.

innerException
Exception

引起当前异常的异常。The exception that is the cause of the current exception. 如果 innerException 参数不为 null,则当前异常将在处理内部异常的 catch 块中引发。If the innerException parameter is not null, 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 should include a reference to the previous exception in the InnerException property. InnerException 属性返回的值与传递到构造函数中的值相同;或者,如果 null 属性没有向构造函数提供内部异常值,则为 InnerExceptionThe InnerException property returns the same value that is passed into the constructor, or null if the InnerException property does not supply the inner exception value to the constructor.

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

属性Property Value
InnerException nullnull.
Message message 中指定的错误消息字符串。The error message string specified in message.

另请参阅

适用于