SEHException SEHException SEHException SEHException Constructors

定义

重载

SEHException() SEHException() SEHException()

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

SEHException(String) SEHException(String) SEHException(String) SEHException(String)

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

SEHException(SerializationInfo, StreamingContext) SEHException(SerializationInfo, StreamingContext) SEHException(SerializationInfo, StreamingContext) SEHException(SerializationInfo, StreamingContext)

从序列化数据初始化 SEHException 类的新实例。Initializes a new instance of the SEHException class from serialization data.

SEHException(String, Exception) SEHException(String, Exception) SEHException(String, Exception) SEHException(String, Exception)

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

SEHException() SEHException() SEHException()

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

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

注解

SEHException 类从 ExternalException 类继承。The SEHException class inherits from the ExternalException class. 此构造函数将Exception对象的属性设置为下表中的值。This constructor sets the properties of the Exception object to the values in the following table.

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

SEHException(String) SEHException(String) SEHException(String) SEHException(String)

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

public:
 SEHException(System::String ^ message);
public SEHException (string message);
new System.Runtime.InteropServices.SEHException : string -> System.Runtime.InteropServices.SEHException
Public Sub New (message As String)

参数

message
String String String String

指示异常原因的消息。The message that indicates the reason for the exception.

注解

SEHException 继承自 ExternalExceptionSEHException inherits from ExternalException. 此构造函数将设置Exception对象的属性, 如下表所示。This constructor sets the properties of the Exception object as shown in the following table.

PropertyProperty “值”Value
InnerException 空引用(在 Visual Basic 中为 Nothing)。A null reference (Nothing in Visual Basic).
Message messagemessage.

SEHException(SerializationInfo, StreamingContext) SEHException(SerializationInfo, StreamingContext) SEHException(SerializationInfo, StreamingContext) SEHException(SerializationInfo, StreamingContext)

从序列化数据初始化 SEHException 类的新实例。Initializes a new instance of the SEHException class from serialization data.

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

参数

info
SerializationInfo SerializationInfo SerializationInfo SerializationInfo

承载序列化对象数据的对象。The object that holds the serialized object data.

context
StreamingContext StreamingContext StreamingContext StreamingContext

关于来源和目标的上下文信息The contextual information about the source or destination.

异常

注解

此构造函数在反序列化过程中调用,以便重建通过流传输的异常对象。This constructor is called during deserialization to reconstitute the exception object transmitted over a stream. 有关更多信息,请参见 System.Runtime.Serialization 命名空间。For more information, see the System.Runtime.Serialization namespace.

SEHException 继承自 ExternalExceptionSEHException inherits from ExternalException.

SEHException(String, Exception) SEHException(String, Exception) SEHException(String, Exception) SEHException(String, Exception)

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

public:
 SEHException(System::String ^ message, Exception ^ inner);
public SEHException (string message, Exception inner);
new System.Runtime.InteropServices.SEHException : string * Exception -> System.Runtime.InteropServices.SEHException
Public Sub New (message As String, inner As Exception)

参数

message
String String String String

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

inner
Exception Exception Exception Exception

导致当前异常的异常。The exception that is the cause of the current exception. 如果 inner 参数不为 null,则当前异常将在处理内部异常的 catch 块中引发。If the inner 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.

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

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

适用于