Bewerken

Delen via


GacIdentityPermission Constructors

Definition

Initializes a new instance of the GacIdentityPermission class.

Overloads

GacIdentityPermission()

Initializes a new instance of the GacIdentityPermission class.

GacIdentityPermission(PermissionState)

Initializes a new instance of the GacIdentityPermission class with fully restricted PermissionState.

GacIdentityPermission()

Source:
GacIdentityPermission.cs
Source:
GacIdentityPermission.cs
Source:
GacIdentityPermission.cs
Source:
GacIdentityPermission.cs

Initializes a new instance of the GacIdentityPermission class.

public:
 GacIdentityPermission();
public GacIdentityPermission ();
Public Sub New ()

Examples

The following code example shows the use of the GacIdentityPermission() constructor.

GacIdentityPermission ^ Gac1 = gcnew GacIdentityPermission;
GacIdentityPermission ^ Gac2 = gcnew GacIdentityPermission( PermissionState::None );
if ( Gac1->Equals( Gac2 ) )
         Console::WriteLine( "GacIdentityPermission() equals GacIdentityPermission(PermissionState.None)." );
GacIdentityPermission Gac1 = new GacIdentityPermission();
GacIdentityPermission Gac2 = new GacIdentityPermission(PermissionState.None);
if (Gac1.Equals(Gac2))
    Console.WriteLine("GacIdentityPermission() equals GacIdentityPermission(PermissionState.None).");
Dim Gac1 As New GacIdentityPermission
Dim Gac2 As New GacIdentityPermission(PermissionState.None)
If (Gac1.Equals(Gac2)) Then
    Console.WriteLine("GacIdentityPermission() equals GacIdentityPermission(PermissionState.None).")
End If

Remarks

This constructor creates a GacIdentityPermission with a PermissionState value of None.

Applies to

GacIdentityPermission(PermissionState)

Source:
GacIdentityPermission.cs
Source:
GacIdentityPermission.cs
Source:
GacIdentityPermission.cs
Source:
GacIdentityPermission.cs

Initializes a new instance of the GacIdentityPermission class with fully restricted PermissionState.

public:
 GacIdentityPermission(System::Security::Permissions::PermissionState state);
public GacIdentityPermission (System.Security.Permissions.PermissionState state);
new System.Security.Permissions.GacIdentityPermission : System.Security.Permissions.PermissionState -> System.Security.Permissions.GacIdentityPermission
Public Sub New (state As PermissionState)

Parameters

state
PermissionState

One of the PermissionState values.

Exceptions

state is not a valid PermissionState value.

Examples

The following code example shows the use of the GacIdentityPermission.GacIdentityPermission(PermissionState) constructor.

GacIdentityPermission ^ Gac1 = gcnew GacIdentityPermission( PermissionState::None );
GacIdentityPermission Gac1 = new GacIdentityPermission(PermissionState.None);
Dim Gac1 As New GacIdentityPermission(PermissionState.None)

Remarks

Note

In the .NET Framework versions 1.0 and 1.1, identity permissions cannot have an Unrestricted permission state value. Starting with the .NET Framework version 2.0, identity permissions can have any permission state value. This means that in 2.0 and later versions, identity permissions have the same behavior as permissions that implement the IUnrestrictedPermission interface.

Applies to