ZoomIn
ZoomIn

Reputation: 1321

Environment.OSVersion doesnt return windows 7

I was trying to display the OS edition using System.Environment in my C# application.

Console.WriteLine("{0}",Environment.OSVersion);

But I see "Microsoft Windows NT 6.1.7600.0" on console,where as I was expecting something similar to "Windows 7 Professional". Why does OSVersion static method return this value?

Upvotes: 0

Views: 1429

Answers (1)

PhonicUK
PhonicUK

Reputation: 13854

Because its for identifying the platform you're running on rather than the 'name' of the version of Windows you're running on. So you can use it to tell if your application is running on a Unix-style OS rather than Windows for example.

You can use the Win32_OperatingSystem WMI class (via System.Management) to get more information about the version of windows you're running on: http://msdn.microsoft.com/en-us/library/windows/desktop/aa394239(v=vs.85).aspx

Upvotes: 2

Related Questions