通过


SEHException 构造函数

定义

初始化 SEHException 类的新实例。

重载

名称 说明
SEHException()

初始化 SEHException 类的新实例。

SEHException(String)

使用指定的消息初始化类的新实例 SEHException

SEHException(SerializationInfo, StreamingContext)
已过时.

从序列化数据初始化类的新实例 SEHException

SEHException(String, Exception)

使用指定的错误消息和对作为此异常原因的内部异常的引用初始化 SEHException 类的新实例。

SEHException()

Source:
SEHException.cs
Source:
SEHException.cs
Source:
SEHException.cs
Source:
SEHException.cs
Source:
SEHException.cs

初始化 SEHException 类的新实例。

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

注解

SEHException 继承自 ExternalException 该类。 此构造函数将对象的属性 Exception 设置为下表中的值。

财产 价值
InnerException Null 引用(Nothing 在 Visual Basic 中)。
Message 本地化的错误消息字符串。

适用于

SEHException(String)

Source:
SEHException.cs
Source:
SEHException.cs
Source:
SEHException.cs
Source:
SEHException.cs
Source:
SEHException.cs

使用指定的消息初始化类的新实例 SEHException

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

参数

message
String

指示异常原因的消息。

注解

SEHException 继承自 ExternalException. 此构造函数设置对象的属性 Exception ,如下表所示。

财产 价值
InnerException Null 引用(Nothing 在 Visual Basic 中)。
Message message

适用于

SEHException(SerializationInfo, StreamingContext)

Source:
SEHException.cs
Source:
SEHException.cs
Source:
SEHException.cs
Source:
SEHException.cs
Source:
SEHException.cs

注意

This API supports obsolete formatter-based serialization. It should not be called or extended by application code.

从序列化数据初始化类的新实例 SEHException

protected:
 SEHException(System::Runtime::Serialization::SerializationInfo ^ info, System::Runtime::Serialization::StreamingContext context);
[System.Obsolete("This API supports obsolete formatter-based serialization. It should not be called or extended by application code.", DiagnosticId="SYSLIB0051", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
protected SEHException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);
protected SEHException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);
[<System.Obsolete("This API supports obsolete formatter-based serialization. It should not be called or extended by application code.", DiagnosticId="SYSLIB0051", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
new System.Runtime.InteropServices.SEHException : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.Runtime.InteropServices.SEHException
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

保存序列化对象数据的对象。

context
StreamingContext

有关源或目标的上下文信息。

属性

例外

infonull

注解

在反序列化期间调用此构造函数以重新构造通过流传输的异常对象。 有关详细信息,请参阅 System.Runtime.Serialization 命名空间。

SEHException 继承自 ExternalException.

适用于

SEHException(String, Exception)

Source:
SEHException.cs
Source:
SEHException.cs
Source:
SEHException.cs
Source:
SEHException.cs
Source:
SEHException.cs

使用指定的错误消息和对作为此异常原因的内部异常的引用初始化 SEHException 类的新实例。

public:
 SEHException(System::String ^ message, Exception ^ inner);
public SEHException(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

说明异常原因的错误消息。

inner
Exception

是当前异常原因的异常。 如果未 innernull 参数,则会在处理内部异常的 catch 块中引发当前异常。

注解

作为上一个异常的直接结果引发的异常应包括对 InnerException 属性中上一个异常的引用。 InnerException 属性返回传入构造函数的相同值,或者如果 null 属性未向构造函数提供内部异常值,则返回 InnerException

下表显示了 SEHException实例的初始属性值。

财产 价值
InnerException 内部异常引用。
Message 错误消息字符串。

另请参阅

适用于