Assembly: mscorlib (in mscorlib.dll)
[SerializableAttribute] [ComVisibleAttribute(true)] public ref class EnvironmentPermission sealed : public CodeAccessPermission, IUnrestrictedPermission
/** @attribute SerializableAttribute() */ /** @attribute ComVisibleAttribute(true) */ public final class EnvironmentPermission extends CodeAccessPermission implements IUnrestrictedPermission
SerializableAttribute ComVisibleAttribute(true) public final class EnvironmentPermission extends CodeAccessPermission implements IUnrestrictedPermission
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.
EnvironmentPermission grants permission for access to the environment variable and its value. To deny access to a variable and its value, you must deny access to it and any other variable which contains the same value. For example, to Deny access to the TMP variable and its value, %USERPROFILE%\Local Settings\Temp, you must Deny access to TMP, TEMP, and any other variable that you can use to access that value. A better technique to deal with multiple paths is to use a combination of PermitOnly and Deny. For more information on this subject and the use of PermitOnly with Deny, see "Canonicalization Problems Using Deny" in Using the Deny Method.
The following code example demonstrates the behavior of the EnvironmentPermission methods.
The example is intended to show how the methods perform if you execute the methods from your code. In general, the methods of permission classes are used by the security infrastructure; they are not typically used in applications.
Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter EditionThe Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.