Method GetProperty
GetProperty(String)
Retrieves the value of an environment variable from the current process.
Declaration
public static string GetProperty(string key)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The name of the environment variable. |
Returns
Type | Description |
---|---|
System.String | The environment variable value. |
GetProperty(String, String)
Retrieves the value of an environment variable from the current process, with a default value if it doens't exist or the caller doesn't have permission to read the value.
Declaration
public static string GetProperty(string key, string defaultValue)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The name of the environment variable. |
System.String | defaultValue | The value to use if the environment variable does not exist or the caller doesn't have permission to read the value. |
Returns
Type | Description |
---|---|
System.String | The environment variable value. |