O'Reilly logo

A Programmer's Guide to .NET by Alexei Fedorov

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

5.5. Access to the environment

The System.Environment class provides information about the current environment and platform. It contains the following properties and methods, which can be used in our applications:

  • CommandLine This property returns the String that contains the command line supplied for this process.

  • CurrentDirectory Indicates the directory (String type) from which this process was started.

  • ExitCode Specifies the exit code for this process as an Integer value.

  • MachineName Contains the String with the name of the computer you are using.

  • NewLine Contains the new line String for this environment.

  • OSVersion Contains an OperatingSystem object.

  • StackTrace This property returns the current stack trace information as a String.

  • SystemDirectory ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required