This article explains the environment class and its members and how to use them in your applications.
Consider a Real World situation in which you need to log username, machine name and so on into a log file. I have encountered this scenario many times. Usually finding such information is a very tedious job and may require some complicated code to be written.For such types of information, Microsoft .NET provides the System.Environment class that provides some static member properties and methods to address most of such scenarios (which turns out to be a complicated implementation otherwise). In this article, I will talk about the System.Environment class and its members and how to use them in your applications.The Environment class defined in the System namespace allows developers to get the information about the current environment and platform.
The Environment class also provides some useful methods.
The following code displays the machine information and logical drives of a machine.
Object Oriented Programming Using C#