EnvironmentPermission::GetPathList Method (EnvironmentPermissionAccess)

 

Gets all environment variables with the specified EnvironmentPermissionAccess.

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

public:
String^ GetPathList(
	EnvironmentPermissionAccess flag
)

Parameters

flag
Type: System.Security.Permissions::EnvironmentPermissionAccess

One of the EnvironmentPermissionAccess values that represents a single type of environment variable access.

Return Value

Type: System::String^

A list of environment variables (semicolon-separated) for the selected flag.

Exception Condition
ArgumentException

flag is not a valid value of EnvironmentPermissionAccess.

-or-

flag is AllAccess, which represents more than one type of environment variable access, or NoAccess, which does not represent any type of environment variable access.

Use this method to get the state of the current permission. To get both Read and Write access states requires two calls to this method.

System_CAPS_noteNote

The flag parameter is limited to the values of EnvironmentPermissionAccess, which represent single types of environment variable access. Those values are Read and Write. The values acceptable to flag do not include NoAccess and AllAccess, which do not represent single types of environment variable access.

The following code example shows the use of the GetPathList method. This code example is part of a larger example provided for the EnvironmentPermission class.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 1.1
Return to top
Show: