Gets the specified environment variable.
[Visual Basic] Public Shared Function GetEnvironmentVariable( _ ByVal variable As String _ ) As String [C#] public static string GetEnvironmentVariable( string variable ); [C++] public: static String* GetEnvironmentVariable( String* variable ); [JScript] public static function GetEnvironmentVariable( variable : String ) : String;
The value (in string form) of the system environment variable given. If the specified environment variable is not found, null is returned.
Exception Type | Condition |
---|---|
ArgumentException | variable is null. |
SecurityException | The caller does not have EnvironmentPermission with Read access. |