Skip to Content
.NET Common Language Runtime Unleashed
book

.NET Common Language Runtime Unleashed

by Kevin Burton
April 2002
Intermediate to advanced content levelIntermediate to advanced
1024 pages
23h 26m
English
Sams
Content preview from .NET Common Language Runtime Unleashed

System.Environment

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).

Listing B.6. Environment Example
 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: ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Customizing the Microsoft® .NET Framework Common Language Runtime

Customizing the Microsoft® .NET Framework Common Language Runtime

Steven Pratschner

Publisher Resources

ISBN: 0672321246Purchase book