Environment: GetEnvironmentVariable

GetEnvironmentVariable

Returns an environment variable value.



 Public Function GetEnvironmentVariable(
	  ByRef Name As String,
	  Optional ByVal Target As EnvironmentVariableTarget = EnvironmentVariableTarget. Process ) As String

Parameters

Name
[ByRef] String. The name of the environment variable to return.
Target
[ByVal] Optional. EnvironmentVariableTarget. The system region to retrieve the variable from.  

Default: EnvironmentVariableTarget . Process

Return Values

String -  The value of the environment variable.

Remarks

If the variable does not exist, then an empty string is returned.

A Target of Process will retrieve the variable from the current process. Other targets will retrieve the variable value from the registry.

See Also

Project CorLib Overview

Class Environment Overview