SecurityPermissionAttribute Sınıf

Tanım

Dikkat

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

Dikkat

CAS support is not available with Silverlight applications.

için güvenlik eylemlerinin SecurityPermission bildirim temelli güvenlik kullanılarak koda uygulanmasına izin verir. Bu sınıf devralınamaz.

public ref class SecurityPermissionAttribute 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 SecurityPermissionAttribute : 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 SecurityPermissionAttribute : 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 SecurityPermissionAttribute : 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 SecurityPermissionAttribute : 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)]
[System.Obsolete("CAS support is not available with Silverlight applications.")]
public sealed class SecurityPermissionAttribute : 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 SecurityPermissionAttribute = 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 SecurityPermissionAttribute = 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 SecurityPermissionAttribute = 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 SecurityPermissionAttribute = 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)>]
[<System.Obsolete("CAS support is not available with Silverlight applications.")>]
type SecurityPermissionAttribute = class
    inherit CodeAccessSecurityAttribute
Public NotInheritable Class SecurityPermissionAttribute
Inherits CodeAccessSecurityAttribute
Devralma
Öznitelikler

Açıklamalar

Dikkat

Kod Erişim Güvenliği (CAS), .NET Framework ve .NET'in tüm sürümlerinde kullanım dışı bırakılmıştır. .NET'in son sürümleri CAS ek açıklamalarını dikkate almaz ve CAS ile ilgili API'ler kullanılıyorsa hata üretir. Geliştiriciler, güvenlik görevlerini yerine getirmek için alternatif yöntemler aramalıdır.

İzin verilen bildirimin kapsamı, kullanılan öğesine SecurityAction bağlıdır.

Bir güvenlik özniteliği tarafından bildirilen güvenlik bilgileri, öznitelik hedefinin meta verilerinde depolanır ve sistem tarafından çalışma zamanında erişilir. Güvenlik öznitelikleri yalnızca bildirim temelli güvenlik için kullanılır. Kesinlik temelli güvenlik için ilgili izin sınıfını kullanın.

sınıfını SecurityPermissionAttribute kullandığınızda, istenen izinlere sahip güvenlik eylemini izleyin. Numaralandırmada SecurityPermissionFlag tanımlandığı gibi istenebilecek her güvenlik izninin sınıfında karşılık gelen bir özelliği SecurityPermissionAttribute vardır. Örneğin, yönetilmeyen koda erişme olanağını talep etmek için talep deyimini istenen özellik ayarıyla birlikte şu şekilde izleyin: SecurityPermissionAttribute(SecurityAction.Demand, UnmanagedCode=true).

Not

Numaralandırma ile özellikler arasındaki SecurityPermissionFlag denkliğin bir istisnası, numaralandırma değerinin AllFlags özelliğiyle Unrestricted temsil edilmiş olmasıdır (sınıfından SecurityAttribute devralınır).SecurityPermissionAttribute Tüm güvenlik izinlerini talep etmek için belirtin Unrestricted=true.

Oluşturucular

SecurityPermissionAttribute(SecurityAction)
Geçersiz.
Geçersiz.

belirtilen SecurityActionile sınıfının yeni bir örneğini SecurityPermissionAttribute başlatır.

Özellikler

Action
Geçersiz.
Geçersiz.

Bir güvenlik eylemi alır veya ayarlar.

(Devralındığı yer: SecurityAttribute)
Assertion
Geçersiz.
Geçersiz.

Tüm bu kodu çağıranların işlem için gerekli izne sahip olduğunu onaylama izninin bildirilip bildirildiğini belirten bir değer alır veya ayarlar.

BindingRedirects
Geçersiz.
Geçersiz.

Kodun uygulama yapılandırma dosyasında bağlama yeniden yönlendirmesi gerçekleştirme izni olup olmadığını belirten bir değer alır veya ayarlar.

ControlAppDomain
Geçersiz.
Geçersiz.

değiştirme AppDomain izninin bildirilip bildirildiğini belirten bir değer alır veya ayarlar.

ControlDomainPolicy
Geçersiz.
Geçersiz.

Etki alanı güvenlik ilkesini değiştirme veya değiştirme izninin bildirildiğini belirten bir değer alır veya ayarlar.

ControlEvidence
Geçersiz.
Geçersiz.

Kanıtı değiştirme veya işleme izninin bildirildiğini belirten bir değer alır veya ayarlar.

ControlPolicy
Geçersiz.
Geçersiz.

Güvenlik ilkesini görüntüleme ve işleme izninin bildirilip bildirildiğini belirten bir değer alır veya ayarlar.

ControlPrincipal
Geçersiz.
Geçersiz.

Geçerli sorumluyu işleme izninin bildirilip bildirildiğini belirten bir değer alır veya ayarlar.

ControlThread
Geçersiz.
Geçersiz.

İş parçacıklarını işleme izninin bildirilip bildirildiğini belirten bir değer alır veya ayarlar.

Execution
Geçersiz.
Geçersiz.

Kod yürütme izninin bildirilip bildirildiğini belirten bir değer alır veya ayarlar.

Flags
Geçersiz.
Geçersiz.

İzinleri içeren SecurityPermission tüm izin bayraklarını alır veya ayarlar.

Infrastructure
Geçersiz.
Geçersiz.

Uzaktan İletişim Bağlam Havuzları, Elçi Havuzları ve Dinamik Havuzlar ekleme gibi, kodun ortak dil çalışma zamanı altyapısına bağlanıp bağlanamayacağını belirten bir değer alır veya ayarlar.

RemotingConfiguration
Geçersiz.
Geçersiz.

Kodun uzaktan iletişim türlerini ve kanalları yapılandırıp yapılandıramayacağını belirten bir değer alır veya ayarlar.

SerializationFormatter
Geçersiz.
Geçersiz.

Kodun bir nesneyi serileştirmek veya seri durumdan çıkarma için serileştirme biçimlendiricisi kullanıp kullanamayacağını belirten bir değer alır veya ayarlar.

SkipVerification
Geçersiz.
Geçersiz.

Kod doğrulamayı atlama izninin bildirilip bildirildiğini belirten bir değer alır veya ayarlar.

TypeId
Geçersiz.
Geçersiz.

Türetilmiş bir sınıfta uygulandığında, bu Attributeiçin benzersiz bir tanımlayıcı alır.

(Devralındığı yer: Attribute)
UnmanagedCode
Geçersiz.
Geçersiz.

Yönetilmeyen kodu çağırma izninin bildirilip bildirilmediğini belirten bir değer alır veya ayarlar.

Unrestricted
Geçersiz.
Geçersiz.

Özniteliği tarafından korunan kaynağa yönelik tam (sınırsız) iznin bildirilip bildirilmediğini belirten bir değer alır veya ayarlar.

(Devralındığı yer: SecurityAttribute)

Yöntemler

CreatePermission()
Geçersiz.
Geçersiz.

Yeni SecurityPermissionbir oluşturur ve döndürür.

Equals(Object)
Geçersiz.
Geçersiz.

Bu örneğin belirtilen bir nesneye eşit olup olmadığını gösteren bir değeri döndürür.

(Devralındığı yer: Attribute)
GetHashCode()
Geçersiz.
Geçersiz.

Bu örneğe ilişkin karma kodu döndürür.

(Devralındığı yer: Attribute)
GetType()
Geçersiz.
Geçersiz.

Type Geçerli örneğini alır.

(Devralındığı yer: Object)
IsDefaultAttribute()
Geçersiz.
Geçersiz.

Türetilmiş bir sınıfta geçersiz kılındığında, bu örneğin değerinin türetilmiş sınıf için varsayılan değer olup olmadığını gösterir.

(Devralındığı yer: Attribute)
Match(Object)
Geçersiz.
Geçersiz.

Türetilmiş bir sınıfta geçersiz kılındığında, bu örneğin belirtilen bir nesneye eşit olup olmadığını gösteren bir değer döndürür.

(Devralındığı yer: Attribute)
MemberwiseClone()
Geçersiz.
Geçersiz.

Geçerli Objectöğesinin sığ bir kopyasını oluşturur.

(Devralındığı yer: Object)
ToString()
Geçersiz.
Geçersiz.

Geçerli nesneyi temsil eden dizeyi döndürür.

(Devralındığı yer: Object)

Belirtik Arabirim Kullanımları

_Attribute.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr)
Geçersiz.
Geçersiz.

Bir ad kümesini karşılık gelen bir dağıtma tanımlayıcısı kümesine eşler.

(Devralındığı yer: Attribute)
_Attribute.GetTypeInfo(UInt32, UInt32, IntPtr)
Geçersiz.
Geçersiz.

Bir arabirimin tür bilgilerini almak için kullanılabilecek bir nesnenin tür bilgilerini alır.

(Devralındığı yer: Attribute)
_Attribute.GetTypeInfoCount(UInt32)
Geçersiz.
Geçersiz.

Bir nesnenin sağladığı tür bilgisi arabirimlerinin sayısını alır (0 ya da 1).

(Devralındığı yer: Attribute)
_Attribute.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr)
Geçersiz.
Geçersiz.

Bir nesne tarafından sunulan özelliklere ve yöntemlere erişim sağlar.

(Devralındığı yer: Attribute)

Şunlara uygulanır

Ayrıca bkz.