System.Environment
Method |
Description |
Method syntax |
Examples |
---|---|---|---|
UserName |
Gets the user name of the person who started the current thread. |
String System.Environment.UserName() |
Criteria Placement |
GetEnvironment |
Variable Retrieves the value of an environment variable. |
String System.Environment.GetEnvironmentVariable (String variable) |
System.Environment.GetEnvironmentVariable("COMPUTERNAME") |
ExpandEnvironment |
Variables Replaces the name of each environment variable embedded in the specified string with the string equivalent of the value of the variable, and then returns the resulting string. |
String System.Environment.ExpandEnvironmentVariables (String inputSting) |
System.Environment.ExpandEnvironmentVariables("My system drive is %SystemDrive% and my system root is %SystemRoot%") |
Current |
Directory Gets the fully qualified path of the current working directory. |
String System.Environment.CurrentDirectory() |
System.Environment.CurrentDirectory() |