DataProtectionPermission DataProtectionPermission DataProtectionPermission DataProtectionPermission Constructors

Definition

Overloads

DataProtectionPermission(PermissionState) DataProtectionPermission(PermissionState) DataProtectionPermission(PermissionState) DataProtectionPermission(PermissionState)

Initializes a new instance of the DataProtectionPermission class with the specified permission state.

DataProtectionPermission(DataProtectionPermissionFlags) DataProtectionPermission(DataProtectionPermissionFlags) DataProtectionPermission(DataProtectionPermissionFlags) DataProtectionPermission(DataProtectionPermissionFlags)

Initializes a new instance of the DataProtectionPermission class with the specified permission flags.

DataProtectionPermission(PermissionState) DataProtectionPermission(PermissionState) DataProtectionPermission(PermissionState) DataProtectionPermission(PermissionState)

Initializes a new instance of the DataProtectionPermission class with the specified permission state.

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

Parameters

Exceptions

Examples

The following code example shows the use of the DataProtectionPermission(PermissionState) constructor. This code example is part of a larger example provided for the DataProtectionPermission class.

DataProtectionPermission ^ sp3 = gcnew DataProtectionPermission( PermissionState::Unrestricted );

DataProtectionPermission sp3 = new DataProtectionPermission(
    PermissionState.Unrestricted);
Dim sp3 As New DataProtectionPermission(PermissionState.Unrestricted)

Remarks

Creates either None (fully restricted) or Unrestricted access to data and memory.

See also

DataProtectionPermission(DataProtectionPermissionFlags) DataProtectionPermission(DataProtectionPermissionFlags) DataProtectionPermission(DataProtectionPermissionFlags) DataProtectionPermission(DataProtectionPermissionFlags)

Initializes a new instance of the DataProtectionPermission class with the specified permission flags.

public:
 DataProtectionPermission(System::Security::Permissions::DataProtectionPermissionFlags flags);
public DataProtectionPermission (System.Security.Permissions.DataProtectionPermissionFlags flags);
new System.Security.Permissions.DataProtectionPermission : System.Security.Permissions.DataProtectionPermissionFlags -> System.Security.Permissions.DataProtectionPermission
Public Sub New (flags As DataProtectionPermissionFlags)

Parameters

Exceptions

Examples

The following code example shows the use of the DataProtectionPermission(DataProtectionPermissionFlags) constructor. This code example is part of a larger example provided for the DataProtectionPermission class.

   Console::WriteLine( "Creating a permission with the Flags property ="
   " ProtectData." );
   DataProtectionPermission ^ sp = gcnew DataProtectionPermission( DataProtectionPermissionFlags::ProtectData );
   
ProtectData();
Console.WriteLine("Creating a permission with the Flags property =" +
    " ProtectData.");
DataProtectionPermission sp = new DataProtectionPermission(
    DataProtectionPermissionFlags.ProtectData);
sp.PermitOnly();
Console.WriteLine("Creating a permission with the Flags property =" + " ProtectData.")
Dim sp As New DataProtectionPermission(DataProtectionPermissionFlags.ProtectData)
sp.PermitOnly()
See also

Applies to