EnvironmentPermissionAccess EnvironmentPermissionAccess EnvironmentPermissionAccess EnvironmentPermissionAccess Enum

定义

指定可访问环境变量。Specifies access to environment variables.

此枚举有一个 FlagsAttribute 属性,允许按位组合成员值。

public enum class EnvironmentPermissionAccess
[System.Flags]
[System.Runtime.InteropServices.ComVisible(true)]
[System.Serializable]
public enum EnvironmentPermissionAccess
type EnvironmentPermissionAccess = 
Public Enum EnvironmentPermissionAccess
继承
EnvironmentPermissionAccessEnvironmentPermissionAccessEnvironmentPermissionAccessEnvironmentPermissionAccess
属性

字段

AllAccess AllAccess AllAccess AllAccess 3

对环境变量的 ReadWrite 访问权限。Read and Write access to environment variables. AllAccess 表示多个 EnvironmentPermissionAccess 值,如果将它用作 ArgumentException 方法的 flag 参数(它需要单一值),则引发 GetPathList(EnvironmentPermissionAccess)AllAccess represents multiple EnvironmentPermissionAccess values and causes an ArgumentException when used as the flag parameter for the GetPathList(EnvironmentPermissionAccess) method, which expects a single value.

NoAccess NoAccess NoAccess NoAccess 0

没有对环境变量的访问权限。No access to environment variables. NoAccess 不表示有效的 EnvironmentPermissionAccess 值,如果将它用作 ArgumentException 的参数(它需要单一值),则引发 GetPathList(EnvironmentPermissionAccess)NoAccess represents no valid EnvironmentPermissionAccess values and causes an ArgumentException when used as the parameter for GetPathList(EnvironmentPermissionAccess), which expects a single value.

Read Read Read Read 1

只指定了环境变量的读访问权限。Only read access to environment variables is specified. 此访问级别不包含环境变量的更改、删除和创建。Changing, deleting and creating environment variables is not included in this access level.

Write Write Write Write 2

只指定了环境变量的写访问权限。Only write access to environment variables is specified. 写访问权限包括创建和删除环境变量,也包括更改它们的现有值。Write access includes creating and deleting environment variables as well as changing existing values. 此访问级别不包括读取环境变量。Reading environment variables is not included in this access level.

注解

此枚举由使用EnvironmentPermissionThis enumeration is used by EnvironmentPermission.

备注

尽管NoAccess EnvironmentPermissionAccess EnvironmentPermission.GetPathListAllAccess显示在中, 但它们不能用作的参数, 因为它们分别描述了环境变量访问类型或所有环境变量访问类型, 以及GetPathList需要一个环境变量访问类型。Although NoAccess and AllAccess appear in EnvironmentPermissionAccess, they are not valid for use as the parameter for EnvironmentPermission.GetPathList because they describe no environment variable access types or all environment variable access types, respectively, and GetPathList expects a single environment variable access type.

适用于

另请参阅