CodeAccessSecurityAttribute Klass

Definition

Varning

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

Anger basattributklassen för kodåtkomstsäkerhet.

public ref class CodeAccessSecurityAttribute abstract : System::Security::Permissions::SecurityAttribute
[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 abstract class CodeAccessSecurityAttribute : System.Security.Permissions.SecurityAttribute
[System.AttributeUsage(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)]
public abstract class CodeAccessSecurityAttribute : System.Security.Permissions.SecurityAttribute
[System.AttributeUsage(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)]
[System.Serializable]
public abstract class CodeAccessSecurityAttribute : System.Security.Permissions.SecurityAttribute
[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 abstract class CodeAccessSecurityAttribute : System.Security.Permissions.SecurityAttribute
[<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 CodeAccessSecurityAttribute = class
    inherit SecurityAttribute
[<System.AttributeUsage(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)>]
type CodeAccessSecurityAttribute = class
    inherit SecurityAttribute
[<System.AttributeUsage(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)>]
[<System.Serializable>]
type CodeAccessSecurityAttribute = class
    inherit SecurityAttribute
[<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 CodeAccessSecurityAttribute = class
    inherit SecurityAttribute
Public MustInherit Class CodeAccessSecurityAttribute
Inherits SecurityAttribute
Arv
CodeAccessSecurityAttribute
Härledda
Attribut

Kommentarer

Caution

Code Access Security (CAS) har föråldrats i alla versioner av .NET Framework och .NET. De senaste versionerna av .NET följer inte CAS-anteckningar och skapar fel om CAS-relaterade API:er används. Utvecklare bör söka alternativa sätt att utföra säkerhetsuppgifter.

Den här attributklassen associerar till exempel SecurityActionett Demandanpassat säkerhetsattribut.

De typer som härleds från CodeAccessSecurityAttribute används för att begränsa åtkomsten till resurser eller skyddsbara åtgärder.

Säkerhetsinformationen som deklareras av ett säkerhetsattribut lagras i metadata för attributmålet och används av systemet vid körning. Säkerhetsattribut används endast för deklarativ säkerhet. Använd motsvarande behörighetsklass som härletts från CodeAccessPermission för imperativ säkerhet.

Anteckningar till implementerare

Alla behörighetsattribut som härleds från den här klassen får bara ha en enda konstruktor som tar en SecurityAction som enda parameter.

Konstruktorer

Name Description
CodeAccessSecurityAttribute(SecurityAction)
Föråldrad.

Initierar en ny instans av CodeAccessSecurityAttribute med angiven SecurityAction.

Egenskaper

Name Description
Action
Föråldrad.

Hämtar eller anger en säkerhetsåtgärd.

(Ärvd från SecurityAttribute)
TypeId
Föråldrad.

När den implementeras i en härledd klass hämtar du en unik identifierare för den här Attribute.

(Ärvd från Attribute)
Unrestricted
Föråldrad.

Hämtar eller anger ett värde som anger om fullständig (obegränsad) behörighet till resursen som skyddas av attributet deklareras.

(Ärvd från SecurityAttribute)

Metoder

Name Description
CreatePermission()
Föråldrad.

När det åsidosätts i en härledd klass skapar du ett behörighetsobjekt som sedan kan serialiseras till binär form och lagras beständigt tillsammans med SecurityAction i en sammansättnings metadata.

(Ärvd från SecurityAttribute)
Equals(Object)
Föråldrad.

Returnerar ett värde som anger om den här instansen är lika med ett angivet objekt.

(Ärvd från Attribute)
GetHashCode()
Föråldrad.

Returnerar hash-koden för den här instansen.

(Ärvd från Attribute)
GetType()
Föråldrad.

Hämtar den aktuella instansen Type .

(Ärvd från Object)
IsDefaultAttribute()
Föråldrad.

När den åsidosättas i en härledd klass anger du om värdet för den här instansen är standardvärdet för den härledda klassen.

(Ärvd från Attribute)
Match(Object)
Föråldrad.

När den åsidosätts i en härledd klass returneras ett värde som anger om den här instansen är lika med ett angivet objekt.

(Ärvd från Attribute)
MemberwiseClone()
Föråldrad.

Skapar en ytlig kopia av den aktuella Object.

(Ärvd från Object)
ToString()
Föråldrad.

Returnerar en sträng som representerar det aktuella objektet.

(Ärvd från Object)

Explicita gränssnittsimplementeringar

Name Description
_Attribute.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr)
Föråldrad.

Mappar en uppsättning namn till en motsvarande uppsättning av sändningsidentifierare.

(Ärvd från Attribute)
_Attribute.GetTypeInfo(UInt32, UInt32, IntPtr)
Föråldrad.

Hämtar typinformationen för ett objekt, som kan användas för att hämta typinformationen för ett gränssnitt.

(Ärvd från Attribute)
_Attribute.GetTypeInfoCount(UInt32)
Föråldrad.

Hämtar antalet typinformationsgränssnitt som ett objekt tillhandahåller (antingen 0 eller 1).

(Ärvd från Attribute)
_Attribute.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr)
Föråldrad.

Ger åtkomst till egenskaper och metoder som exponeras av ett objekt.

(Ärvd från Attribute)

Gäller för

Se även