Method GetEnv
| Improve this Doc View SourceGetEnv(String)
Gets the value of an environment variable from the current process.
Declaration
public static string GetEnv(this string variable)
Parameters
Type | Name | Description |
---|---|---|
String | variable | The name of the environment variable. |
Returns
Type | Description |
---|---|
String | The value of the environment variable. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
VariableNotSetException |
|
GetEnv<TConversionType>(String)
Gets the value of an environment variable in a specific format.
Declaration
public static TConversionType GetEnv<TConversionType>(this string variable)
where TConversionType : IConvertible
Parameters
Type | Name | Description |
---|---|---|
String | variable | The name of the environment variable. |
Returns
Type | Description |
---|---|
TConversionType | An value whose type is |
Type Parameters
Name | Description |
---|---|
TConversionType | The type of object to return. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
VariableNotSetException |
|