通过


HostProtectionException 构造函数

定义

初始化 HostProtectionException 类的新实例。

重载

名称 说明
HostProtectionException()

使用默认值初始化 HostProtectionException 类的新实例。

HostProtectionException(String)

使用指定的错误消息初始化类的新实例 HostProtectionException

HostProtectionException(SerializationInfo, StreamingContext)
已过时.

使用提供的序列化信息和流式处理上下文初始化类的新实例 HostProtectionException

HostProtectionException(String, Exception)

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

HostProtectionException(String, HostProtectionResource, HostProtectionResource)

使用指定的错误消息、受保护的主机资源和导致引发异常的主机资源初始化类的新实例 HostProtectionException

HostProtectionException()

Source:
HostProtectionException.cs
Source:
HostProtectionException.cs
Source:
HostProtectionException.cs
Source:
HostProtectionException.cs
Source:
HostProtectionException.cs
Source:
HostProtectionException.cs
Source:
HostProtectionException.cs

使用默认值初始化 HostProtectionException 类的新实例。

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

注解

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

财产 价值
ProtectedResources HostProtectionResource.None
DemandedResources HostProtectionResource.None

适用于

HostProtectionException(String)

Source:
HostProtectionException.cs
Source:
HostProtectionException.cs
Source:
HostProtectionException.cs
Source:
HostProtectionException.cs
Source:
HostProtectionException.cs
Source:
HostProtectionException.cs
Source:
HostProtectionException.cs

使用指定的错误消息初始化类的新实例 HostProtectionException

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

参数

message
String

描述错误的消息。

注解

参数的内容 message 应该对用户理解。 此构造函数的调用方必须确保此字符串已本地化为当前系统区域性。

适用于

HostProtectionException(SerializationInfo, StreamingContext)

Source:
HostProtectionException.cs
Source:
HostProtectionException.cs
Source:
HostProtectionException.cs
Source:
HostProtectionException.cs
Source:
HostProtectionException.cs
Source:
HostProtectionException.cs
Source:
HostProtectionException.cs

注意

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

使用提供的序列化信息和流式处理上下文初始化类的新实例 HostProtectionException

protected:
 HostProtectionException(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 HostProtectionException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);
protected HostProtectionException(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.Security.HostProtectionException : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.Security.HostProtectionException
new System.Security.HostProtectionException : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.Security.HostProtectionException
Protected Sub New (info As SerializationInfo, context As StreamingContext)

参数

info
SerializationInfo

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

context
StreamingContext

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

属性

例外

infonull

注解

在反序列化期间调用此构造函数以重新构造通过流传输的异常对象。

适用于

HostProtectionException(String, Exception)

Source:
HostProtectionException.cs
Source:
HostProtectionException.cs
Source:
HostProtectionException.cs
Source:
HostProtectionException.cs
Source:
HostProtectionException.cs
Source:
HostProtectionException.cs
Source:
HostProtectionException.cs

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

public:
 HostProtectionException(System::String ^ message, Exception ^ e);
public HostProtectionException(string message, Exception e);
new System.Security.HostProtectionException : string * Exception -> System.Security.HostProtectionException
Public Sub New (message As String, e As Exception)

参数

message
String

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

e
Exception

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

注解

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

适用于

HostProtectionException(String, HostProtectionResource, HostProtectionResource)

Source:
HostProtectionException.cs
Source:
HostProtectionException.cs
Source:
HostProtectionException.cs
Source:
HostProtectionException.cs
Source:
HostProtectionException.cs
Source:
HostProtectionException.cs
Source:
HostProtectionException.cs

使用指定的错误消息、受保护的主机资源和导致引发异常的主机资源初始化类的新实例 HostProtectionException

public:
 HostProtectionException(System::String ^ message, System::Security::Permissions::HostProtectionResource protectedResources, System::Security::Permissions::HostProtectionResource demandedResources);
public HostProtectionException(string message, System.Security.Permissions.HostProtectionResource protectedResources, System.Security.Permissions.HostProtectionResource demandedResources);
new System.Security.HostProtectionException : string * System.Security.Permissions.HostProtectionResource * System.Security.Permissions.HostProtectionResource -> System.Security.HostProtectionException
Public Sub New (message As String, protectedResources As HostProtectionResource, demandedResources As HostProtectionResource)

参数

message
String

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

protectedResources
HostProtectionResource

枚举值的按位组合,指定部分受信任代码无法访问的主机资源。

demandedResources
HostProtectionResource

指定所需主机资源的枚举值的按位组合。

注解

demandedResources 参数指定导致引发异常的所需主机保护类别。 例如,假设某个方法具有一个 HostProtectionAttribute 属性,指示该方法公开共享状态。 调用该方法时,将 HostProtectionAttribute 执行共享状态的链接需求。 如果主机已将共享状态设置为禁止类别,则会引发属性值为 <a0 /a0>。

适用于