I'd use something like below to get the enumerated platform ID.
It tells you whether the OS is NT or higher. One might want to
be more specific than that (or break it down further). It's more
direct thaan parsing the string (5.1 is really the platform ID of
Win32NT/enum)
The meaning of the platform ID enum is
Win32NT
Supported by the .NET Compact Framework.
The operating system is Windows NT or later.
Win32S
Supported by the .NET Compact Framework.
The operating system is Win32s. Win32s is a layer that runs on 16-bit
versions of Windows to provide access to 32-bit applications.
Win32Windows
Supported by the .NET Compact Framework.
The operating system is Windows 95 or later.
WinCE
Supported by the .NET Compact Framework.
The operating system is Windows CE .NET.
Here's a VB .NET sample to read it:
Private Environment As System.Environm ent
--------------------------
Dim OpSystem As OperatingSystem
Dim PlatformID As PlatformID
OpSystem = Environment.OSV ersion
PlatformID = OpSystem.Platfo rm
"James" wrote:
I can get the windows version number from System.Environm ent.OSVersion e.g.
"Windows NT 5.1.2600.0" for XP SP2.
I was wondering whether this tells you the type of windows it is or if you
have to use something else?
E.g. for windows 2000 do you just get a version number, or can you tell if
it is Professional, Server, Advanced Server, Datacenter Server.