EnvironmentPermission Constructors

Definition

Initializes a new instance of the EnvironmentPermission class.

Overloads

EnvironmentPermission(PermissionState)

Initializes a new instance of the EnvironmentPermission class with either restricted or unrestricted permission as specified.

EnvironmentPermission(EnvironmentPermissionAccess, String)

Initializes a new instance of the EnvironmentPermission class with the specified access to the specified environment variables.

EnvironmentPermission(PermissionState)

Initializes a new instance of the EnvironmentPermission class with either restricted or unrestricted permission as specified.

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

Parameters

state
PermissionState

One of the PermissionState values.

Exceptions

The state parameter is not a valid value of PermissionState.

Remarks

Creates either fully restricted (None) or Unrestricted access to all environment variables.

EnvironmentPermission(EnvironmentPermissionAccess, String)

Initializes a new instance of the EnvironmentPermission class with the specified access to the specified environment variables.

public:
 EnvironmentPermission(System::Security::Permissions::EnvironmentPermissionAccess flag, System::String ^ pathList);
public EnvironmentPermission (System.Security.Permissions.EnvironmentPermissionAccess flag, string pathList);
new System.Security.Permissions.EnvironmentPermission : System.Security.Permissions.EnvironmentPermissionAccess * string -> System.Security.Permissions.EnvironmentPermission
Public Sub New (flag As EnvironmentPermissionAccess, pathList As String)

Parameters

pathList
String

A list of environment variables (semicolon-separated) to which access is granted.

Exceptions

The pathList parameter is null.

The flag parameter is not a valid value of EnvironmentPermissionAccess.

Remarks

This constructor allows only one of the EnvironmentPermissionAccess values to be specified. This access applies to all listed environment variables. Use AddPathList to define complex permissions.

Applies to