共用方式為


HostProtectionException 建構函式

定義

初始化 HostProtectionException 類別的新執行個體。

多載

名稱 Description
HostProtectionException()

使用預設值,初始化 HostProtectionException 類別的新實例。

HostProtectionException(String)

初始化類別的新實例 HostProtectionException 並指定錯誤訊息。

HostProtectionException(SerializationInfo, StreamingContext)
已淘汰.

利用提供的序列化資訊與串流上下文初始化該類別的新實例 HostProtectionException

HostProtectionException(String, Exception)

初始化類別的新實例 HostProtectionException ,並附上指定的錯誤訊息及導致該異常的內部例外的參考。

HostProtectionException(String, HostProtectionResource, HostProtectionResource)

初始化一個新的類別實例 HostProtectionException ,並以指定的錯誤訊息、受保護的主機資源,以及導致例外拋出的主機資源。

HostProtectionException()

來源:
HostProtectionException.cs
來源:
HostProtectionException.cs
來源:
HostProtectionException.cs
來源:
HostProtectionException.cs
來源:
HostProtectionException.cs
來源:
HostProtectionException.cs
來源:
HostProtectionException.cs

使用預設值,初始化 HostProtectionException 類別的新實例。

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

備註

下表顯示該 HostProtectionException 類別實例的初始屬性值。

房產 價值
ProtectedResources HostProtectionResource.None
DemandedResources HostProtectionResource.None

適用於

HostProtectionException(String)

來源:
HostProtectionException.cs
來源:
HostProtectionException.cs
來源:
HostProtectionException.cs
來源:
HostProtectionException.cs
來源:
HostProtectionException.cs
來源:
HostProtectionException.cs
來源:
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)

來源:
HostProtectionException.cs
來源:
HostProtectionException.cs
來源:
HostProtectionException.cs
來源:
HostProtectionException.cs
來源:
HostProtectionException.cs
來源:
HostProtectionException.cs
來源:
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)

來源:
HostProtectionException.cs
來源:
HostProtectionException.cs
來源:
HostProtectionException.cs
來源:
HostProtectionException.cs
來源:
HostProtectionException.cs
來源:
HostProtectionException.cs
來源:
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

該例外即為當前例外的原因。 若 innerException 參數不 null為 ,則在處理內部異常的區塊中提出 catch 當前例外。

備註

因先前例外直接拋出的例外,可以包含對該屬性中先前 InnerException 例外的參考。 該 InnerException 屬性回傳與傳入建構子相同的值,或 null 若該 InnerException 性質未提供內部例外值給建構子。

適用於

HostProtectionException(String, HostProtectionResource, HostProtectionResource)

來源:
HostProtectionException.cs
來源:
HostProtectionException.cs
來源:
HostProtectionException.cs
來源:
HostProtectionException.cs
來源:
HostProtectionException.cs
來源:
HostProtectionException.cs
來源:
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 執行連結需求以取得共享狀態。 若主機將共享狀態設為禁止類別,則 a HostProtectionException 會被提出屬性 demandedResources 值為 HostProtectionResource.SharedState

適用於