AccessViolationException AccessViolationException AccessViolationException AccessViolationException Constructors

定义

重载

AccessViolationException() AccessViolationException() AccessViolationException()

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

AccessViolationException(String) AccessViolationException(String) AccessViolationException(String) AccessViolationException(String)

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

AccessViolationException(SerializationInfo, StreamingContext) AccessViolationException(SerializationInfo, StreamingContext) AccessViolationException(SerializationInfo, StreamingContext) AccessViolationException(SerializationInfo, StreamingContext)

用序列化数据初始化 AccessViolationException 类的新实例。Initializes a new instance of the AccessViolationException class with serialized data.

AccessViolationException(String, Exception) AccessViolationException(String, Exception) AccessViolationException(String, Exception) AccessViolationException(String, Exception)

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

AccessViolationException() AccessViolationException() AccessViolationException()

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

public:
 AccessViolationException();
public AccessViolationException ();
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 "Attempted to read or write protected memory. 这通常表示其他内存已损坏。This is often an indication that other memory has been corrupted." 此消息将当前系统区域性考虑在内。This message takes into account the current system culture.

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

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

AccessViolationException(String) AccessViolationException(String) AccessViolationException(String) AccessViolationException(String)

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

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

参数

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

注解

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

PropertyProperty Value
InnerException nullnull.
Message message 中指定的错误消息字符串。The error message string specified in message.
另请参阅

AccessViolationException(SerializationInfo, StreamingContext) AccessViolationException(SerializationInfo, StreamingContext) AccessViolationException(SerializationInfo, StreamingContext) AccessViolationException(SerializationInfo, StreamingContext)

用序列化数据初始化 AccessViolationException 类的新实例。Initializes a new instance of the AccessViolationException class with serialized data.

protected:
 AccessViolationException(System::Runtime::Serialization::SerializationInfo ^ info, System::Runtime::Serialization::StreamingContext context);
protected AccessViolationException (System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);
new AccessViolationException : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> AccessViolationException
Protected Sub New (info As SerializationInfo, context As StreamingContext)

参数

info
SerializationInfo SerializationInfo SerializationInfo SerializationInfo

一个 SerializationInfo,用于保存序列化对象数据。The SerializationInfo that holds the serialized object data.

context
StreamingContext StreamingContext StreamingContext StreamingContext

StreamingContext,它包含关于源或目标的上下文信息。The StreamingContext that contains contextual information about the source or destination.

注解

此构造函数在反序列化过程中调用,以便重建通过流传输的异常对象。This constructor is called during deserialization to reconstitute the exception object transmitted over a stream. 有关详细信息,请参阅XML 和 SOAP 序列化For more information, see XML and SOAP Serialization.

另请参阅

AccessViolationException(String, Exception) AccessViolationException(String, Exception) AccessViolationException(String, Exception) AccessViolationException(String, Exception)

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

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

参数

message
String String String 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 Exception Exception 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.

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

PropertyProperty Value
InnerException nullnull.
Message message 中指定的错误消息字符串。The error message string specified in message.
另请参阅

适用于