共用方式為


DnsPermissionAttribute 類別

定義

警告

Code Access Security is not supported or honored by the runtime.

規定有權向網域名稱伺服器請求資訊。

public ref class DnsPermissionAttribute sealed : System::Security::Permissions::CodeAccessSecurityAttribute
[System.AttributeUsage(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)]
[System.Obsolete("Code Access Security is not supported or honored by the runtime.", DiagnosticId="SYSLIB0003", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public sealed class DnsPermissionAttribute : System.Security.Permissions.CodeAccessSecurityAttribute
[System.AttributeUsage(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)]
[System.Serializable]
public sealed class DnsPermissionAttribute : System.Security.Permissions.CodeAccessSecurityAttribute
[System.AttributeUsage(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)]
public sealed class DnsPermissionAttribute : System.Security.Permissions.CodeAccessSecurityAttribute
[<System.AttributeUsage(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)>]
[<System.Obsolete("Code Access Security is not supported or honored by the runtime.", DiagnosticId="SYSLIB0003", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
type DnsPermissionAttribute = class
    inherit CodeAccessSecurityAttribute
[<System.AttributeUsage(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)>]
[<System.Serializable>]
type DnsPermissionAttribute = class
    inherit CodeAccessSecurityAttribute
[<System.AttributeUsage(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)>]
type DnsPermissionAttribute = class
    inherit CodeAccessSecurityAttribute
Public NotInheritable Class DnsPermissionAttribute
Inherits CodeAccessSecurityAttribute
繼承
屬性

備註

謹慎

程式碼存取安全(CAS)已在所有版本的 .NET Framework 與 .NET 中被棄用。 最新版本的 .NET 不承認 CAS 標註,若使用 CAS 相關 API,則會產生錯誤。 開發人員應尋求其他方法來完成安全任務。

DnsPermissionAttribute 宣告的安全資訊儲存在屬性目標的元資料中,而該屬性即為所套用的類別 DnsPermissionAttribute 。 系統接著在執行時存取這些資訊。 傳遞給建構子的 SecurityAction THE 決定了允許的 DNS 目標。

這些安全屬性僅用於宣告式安全。 對於命令式安全,請使用相應 DnsPermission 的類別。

安全存取要麼完全受限制,要麼完全不受限制。 設定 Unrestricted 屬性為 授權 true 存取權,或 false 是不存取權限。 將此屬性設為命名參數。

欲了解更多屬性的使用資訊,請參閱屬性。

建構函式

名稱 Description
DnsPermissionAttribute(SecurityAction)
已淘汰.

初始化一個以指定DnsPermissionAttribute值的新SecurityAction類別實例。

屬性

名稱 Description
Action
已淘汰.

取得或設定安全性動作。

(繼承來源 SecurityAttribute)
TypeId
已淘汰.

在衍生類別中實作時,取得這個 Attribute的唯一標識碼。

(繼承來源 Attribute)
Unrestricted
已淘汰.

取得或設定一個值,表示是否宣告了對該屬性保護的資源的完整(無限制)權限。

(繼承來源 SecurityAttribute)

方法

名稱 Description
CreatePermission()
已淘汰.

建立並回傳該類別的新實例 DnsPermission

Equals(Object)
已淘汰.

傳回值,這個值表示這個實例是否等於指定的物件。

(繼承來源 Attribute)
GetHashCode()
已淘汰.

傳回這個實例的哈希碼。

(繼承來源 Attribute)
GetType()
已淘汰.

取得目前實例的 Type

(繼承來源 Object)
IsDefaultAttribute()
已淘汰.

在衍生類別中覆寫時,指出這個實例的值是否為衍生類別的預設值。

(繼承來源 Attribute)
Match(Object)
已淘汰.

在衍生類別中覆寫時,傳回值,指出這個實例是否等於指定的物件。

(繼承來源 Attribute)
MemberwiseClone()
已淘汰.

建立目前 Object的淺層複本。

(繼承來源 Object)
ToString()
已淘汰.

傳回表示目前 物件的字串。

(繼承來源 Object)

明確介面實作

名稱 Description
_Attribute.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr)
已淘汰.

將一組名稱對應至一組對應的分派識別項 (Dispatch Identifier)。

(繼承來源 Attribute)
_Attribute.GetTypeInfo(UInt32, UInt32, IntPtr)
已淘汰.

擷取 物件的型別資訊,可用來取得介面的類型資訊。

(繼承來源 Attribute)
_Attribute.GetTypeInfoCount(UInt32)
已淘汰.

擷取物件提供的類型資訊介面數目 (0 或 1)。

(繼承來源 Attribute)
_Attribute.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr)
已淘汰.

提供物件所公開屬性和方法的存取權。

(繼承來源 Attribute)

適用於

另請參閱