C#: System.Environment

Here are a few handy properties and methods that are found on the System.Environment class:

Current OS: System.Environment.OSVersion

Current working directory: System.Environment.CurrentDirectory

string[] of drives on the machine: System.Environment.GetLogicalDrives()

Version of .NET app is running under: System.Environment.Version

Current machine name: System.Environment.MachineName

Newline symbol for the current environment: System.Environment.NewLine

Number of processors on the current machine: System.Environment.ProcessorCount

Full path to system directory: System.Environment.SystemDirectory

User name application is running under: System.Environment.UserName

Leave a Reply

Your email address will not be published. Required fields are marked *