Share via


EnvironmentPermissionAttribute Kelas

Definisi

Perhatian

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

Memungkinkan tindakan keamanan untuk EnvironmentPermission diterapkan ke kode menggunakan keamanan deklaratif. Kelas ini tidak dapat diwariskan.

public ref class EnvironmentPermissionAttribute 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 EnvironmentPermissionAttribute : 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 EnvironmentPermissionAttribute : 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]
[System.Runtime.InteropServices.ComVisible(true)]
public sealed class EnvironmentPermissionAttribute : 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 EnvironmentPermissionAttribute : 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 EnvironmentPermissionAttribute = 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 EnvironmentPermissionAttribute = 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>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type EnvironmentPermissionAttribute = 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 EnvironmentPermissionAttribute = class
    inherit CodeAccessSecurityAttribute
Public NotInheritable Class EnvironmentPermissionAttribute
Inherits CodeAccessSecurityAttribute
Warisan
Atribut

Keterangan

Perhatian

Keamanan Akses Kode (CAS) tidak digunakan lagi di semua versi .NET Framework dan .NET. Versi terbaru .NET tidak mematuhi anotasi CAS dan menghasilkan kesalahan jika API terkait CAS digunakan. Pengembang harus mencari cara alternatif untuk menyelesaikan tugas keamanan.

Ruang lingkup deklarasi yang diizinkan tergantung pada SecurityAction yang digunakan.

Informasi keamanan yang dideklarasikan oleh atribut keamanan disimpan dalam metadata target atribut dan diakses oleh sistem pada durasi. Atribut keamanan hanya digunakan untuk keamanan deklaratif. Untuk keamanan imperatif, gunakan kelas izin yang sesuai.

Nama variabel lingkungan tidak peka huruf besar/kecil. Beberapa nama variabel lingkungan ditentukan dengan memisahkan nama menggunakan PathSeparator.

Konstruktor

EnvironmentPermissionAttribute(SecurityAction)
Kedaluwarsa.

Menginisialisasi instans EnvironmentPermissionAttribute baru kelas dengan yang ditentukan SecurityAction.

Properti

Action
Kedaluwarsa.

Mendapatkan atau mengatur tindakan keamanan.

(Diperoleh dari SecurityAttribute)
All
Kedaluwarsa.

Mengatur akses penuh untuk variabel lingkungan yang ditentukan oleh nilai string.

Read
Kedaluwarsa.

Mendapatkan atau mengatur akses baca untuk variabel lingkungan yang ditentukan oleh nilai string.

TypeId
Kedaluwarsa.

Ketika diimplementasikan di kelas turunan, mendapatkan pengidentifikasi unik untuk ini Attribute.

(Diperoleh dari Attribute)
Unrestricted
Kedaluwarsa.

Mendapatkan atau menetapkan nilai yang menunjukkan apakah izin penuh (tidak terbatas) ke sumber daya yang dilindungi oleh atribut dideklarasikan.

(Diperoleh dari SecurityAttribute)
Write
Kedaluwarsa.

Mendapatkan atau mengatur akses tulis untuk variabel lingkungan yang ditentukan oleh nilai string.

Metode

CreatePermission()
Kedaluwarsa.

Membuat dan mengembalikan yang baru EnvironmentPermission.

Equals(Object)
Kedaluwarsa.

Mengembalikan nilai yang menunjukkan apakah instans ini sama dengan objek tertentu.

(Diperoleh dari Attribute)
GetHashCode()
Kedaluwarsa.

Mengembalikan kode hash untuk instans ini.

(Diperoleh dari Attribute)
GetType()
Kedaluwarsa.

Mendapatkan dari instans Type saat ini.

(Diperoleh dari Object)
IsDefaultAttribute()
Kedaluwarsa.

Ketika ditimpa di kelas turunan, menunjukkan apakah nilai instans ini adalah nilai default untuk kelas turunan.

(Diperoleh dari Attribute)
Match(Object)
Kedaluwarsa.

Saat ditimpa di kelas turunan, mengembalikan nilai yang menunjukkan apakah instans ini sama dengan objek tertentu.

(Diperoleh dari Attribute)
MemberwiseClone()
Kedaluwarsa.

Membuat salinan dangkal dari saat ini Object.

(Diperoleh dari Object)
ToString()
Kedaluwarsa.

Mengembalikan string yang mewakili objek saat ini.

(Diperoleh dari Object)

Implementasi Antarmuka Eksplisit

_Attribute.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr)
Kedaluwarsa.

Memetakan sekumpulan nama ke sekumpulan pengidentifikasi pengiriman yang sesuai.

(Diperoleh dari Attribute)
_Attribute.GetTypeInfo(UInt32, UInt32, IntPtr)
Kedaluwarsa.

Mengambil informasi jenis untuk objek, yang dapat digunakan untuk mendapatkan informasi jenis untuk antarmuka.

(Diperoleh dari Attribute)
_Attribute.GetTypeInfoCount(UInt32)
Kedaluwarsa.

Mengambil jumlah antarmuka informasi jenis yang disediakan objek (baik 0 atau 1).

(Diperoleh dari Attribute)
_Attribute.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr)
Kedaluwarsa.

Menyediakan akses ke properti dan metode yang diekspos oleh objek.

(Diperoleh dari Attribute)

Berlaku untuk

Lihat juga