DataProtectionPermission Constructor (PermissionState)

 

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

Namespace:   System.Security.Permissions
Assembly:  System.Security (in System.Security.dll)

public DataProtectionPermission(
	PermissionState state
)

Parameters

state
Type: System.Security.Permissions.PermissionState

One of the PermissionState values.

Exception Condition
ArgumentException

state is not a valid PermissionState value.

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

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 = new DataProtectionPermission(
    PermissionState.Unrestricted);

.NET Framework
Available since 2.0
Return to top
Show: