How to obtain Operating System information in .NET


If you want to know the basic information such as operating system name, version, service pack or platform name of the operating system on which your .NET application is running you can use following properties of Environment class.

Console.WriteLine(Environment.OSVersion); 
Console.WriteLine(Environment.OSVersion.Version);
Console.WriteLine(Environment.OSVersion.ServicePack);
Console.WriteLine(Environment.OSVersion.Platform);

 

 

About author


User avatar

Waqas Anwar

Founder of EzzyLearning.com, Senior Consultant, Microsoft .NET and Web Technologies

Comments