Aracılığıyla paylaş


GacIdentityPermissionAttribute(SecurityAction) Oluşturucu

Tanım

Belirtilen SecurityAction değerle sınıfının yeni bir örneğini GacIdentityPermissionAttribute başlatır.

public:
 GacIdentityPermissionAttribute(System::Security::Permissions::SecurityAction action);
public GacIdentityPermissionAttribute (System.Security.Permissions.SecurityAction action);
new System.Security.Permissions.GacIdentityPermissionAttribute : System.Security.Permissions.SecurityAction -> System.Security.Permissions.GacIdentityPermissionAttribute
Public Sub New (action As SecurityAction)

Parametreler

action
SecurityAction

Değerlerden SecurityAction biri.

Özel durumlar

action Parametresi geçerli SecurityAction bir değer değil.

Örnekler

Aşağıdaki kod örneği, çağıran programın genel derleme önbelleğinde olmasını talep etmek için oluşturucunun kullanımını GacIdentityPermissionAttribute gösterir. Bu örnek, sınıfı için GacIdentityPermissionAttribute sağlanan daha büyük bir örneğin parçasıdır.

// Demand that the calling program be in the global assembly cache.
[GacIdentityPermissionAttribute(SecurityAction::Demand)]
public ref class Class1
// Demand that the calling program be in the global assembly cache.
[GacIdentityPermissionAttribute(SecurityAction.Demand)]
public class Class1
' Demand that the calling program be in the global assembly cache.
<GacIdentityPermissionAttribute(SecurityAction.Demand)> _
Public Class Class1

Açıklamalar

Oluşturucu, değeri doğrulamak SecurityAction için temel sınıfı çağırır.

Bu oluşturucu bir SecurityAction (örneğin, Demand) ile ilişkilendirir GacIdentityPermission.

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 kullanın GacIdentityPermission .

Şunlara uygulanır