Expand
EnvironmentPermission Class

Controls access to system and user environment variables. This class cannot be inherited.

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

'Declaration

<SerializableAttribute> _
<ComVisibleAttribute(True)> _
Public NotInheritable Class EnvironmentPermission _
	Inherits CodeAccessPermission _
	Implements IUnrestrictedPermission
Remarks

Environment variable names are designated by one or more case-insensitive name lists separated by semicolons, with separate lists for read and write access to the named variables. Write access includes the ability to create and delete environment variables as well as to change existing values.

NoteNote

In versions of the .NET Framework before the .NET Framework version 4, you could use the CodeAccessPermission.Deny method to prevent inadvertent access to system resources by trusted code. Deny is now obsolete, and access to resources is now determined solely by the granted permission set for an assembly. To limit access to files, you must run partially trusted code in a sandbox and assign it permissions only to resources that the code is allowed to access. For information about running an application in a sandbox, see How to: Run Partially Trusted Code in a Sandbox.

Inheritance Hierarchy

System.Object
  System.Security.CodeAccessPermission
    System.Security.Permissions.EnvironmentPermission
Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Platforms

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role not supported), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Version Information

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Community ContentAdd
Page view tracker