Background
In this article we will learn about the Environment class of C#,which provides the machine configuration details,Program execution Environment details as well as some properties which is used to break the one line into new line which is written in the program for output.
Let us learn the definition of array so beginners can also understand.
What is Environment class ?
Environment class is static class which Provides the system configuration,Current program execution Environment as wel some properties for string manipulation such as news line,System Namespace represents the Environment Class.
Environment class is a combination of functions and Properties which represent the Environment variable details using IDictionary in the form of key,value pairs.
we can also loop through Dictionary to get all Environment variable details,before introducing all Environment variable,let us go through some frequently used Environment variable details.
as we Environment class is the static class because of this we directly access the methods and properties with help of class name itself without creating object.
Let us see

As explained above defination ,Environment class is the static class which provides the some properties and function as you can see in the above Image.
You can access the particular property or function as
Example
- Environment.OSVersion.ToString(); //Operating system Details
- Environment.NewLine.ToString(); //string will split into New line
- Environment.MachineName.ToString();//Machine Name
- Environment.Is64BitProcess.ToString();//checkes whether the system is 64 bit
- Environment.ProcessorCount.ToString();//gets the number of process currently running on current machine
- Environment.UserDomainName.ToString();//gets the network domain name which is currently associated with current User Computer
- Environment.UserName.ToString();//gets the username of person who currently logged on the windows operating System system
- Environment.WorkingSet.ToString();//gets the Amount of physical memory mapped to the process contex
- Environment.Exit(12);//terminates the process and gives the underlying operating system the Specified exit code
- Environment.CurrentDirectory.ToString();//gets the full path of current working directory.
- Environment.HasShutdownStarted.ToString();//Gets the Value whether CLR is shutting down
- Environment.SystemPageSize.ToString();//gets the Amount of memory for an operating system's Page file.
To demonstrate the above properties lets us create the one console application,as


Join the conversation! Your thoughts help the community grow.