EnvironmentPermission Constructors
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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)
- Source:
- EnvironmentPermission.cs
- Source:
- EnvironmentPermission.cs
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.
Applies to
EnvironmentPermission(EnvironmentPermissionAccess, String)
- Source:
- EnvironmentPermission.cs
- Source:
- EnvironmentPermission.cs
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
One of the EnvironmentPermissionAccess values.
- 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.