April 2002
Intermediate to advanced
1024 pages
23h 26m
English
Use this class to retrieve the following information:
Command-line arguments
Current directory
System directory
Exit codes
Machine name
Domain name
Username
Tick count
Newline character sequence
OS version
Environment variable settings
Contents of the call stack
Version of the CLR
Working set
Listing B.6 shows a sample program calling some of the environment methods and properties (environment.cs).
static void Main(string [] args) { Console.WriteLine("Command line: {0} ", Environment.CommandLine); Console.WriteLine("Directory: {0} ", Environment.CurrentDirectory); Console.WriteLine("Exit Code: {0} ", Environment.ExitCode); Console.WriteLine("Machine name: {0} ", Environment.MachineName); Console.Write("NewLine: ... |