I stumbled upon this oddity today while playing with some code to go down different pathways in an application depending upon which Windows OS was running. The following code:
OperatingSystem os = Environment.OSVersion;
Version v = os.Version;
string osv = v.ToString();
Console.WriteLine("Revision=" + v.Revision.ToString());
Console.WriteLine("MinorRevision=" + v.MinorRevision.ToString());
Console.WriteLine("Minor=" + v.Minor.ToString());
Console.WriteLine("Major=" + v.Major.ToString());
Console.WriteLine("MajorRevision=" + v.MajorRevision.ToString());
Console.WriteLine(osv);
On my XP SP3 workstation the code above displays:
Revision开发者_开发知识库=196608
MinorRevision=0
Minor=1
Major=5
MajorRevision=3
5.1.2600.196608
On one of our Win2003 SP2 servers it displays:
Revision=131072
MinorRevision=0
Minor=2
Major=5
MajorRevision=2
5.2.3790.131072
I was a little suprised at this, since the Major version number suggests that XP and Windows Server 2003 are basically the same version of Windows, with merely a minor version difference. Not entirely sure what the term "MajorRevision" means.
I was assuming that the third term in the full version number is the Build number, but v.Build actually returns blank in both cases.
That's the version number of the Windows NT kernel.
- 5.0: Windows 2000
- 5.1: Windows XP
- 5.2: Windows Server 2003
- 6.0: Windows Vista, Windows Server 2008
- 6.1: Windows 7, Windows Server 2008 R2
Windows Server 2003 is in fact fairly similar to Windows XP at the kernel level, though there are many differences in the layers above the kernel, obviously. The Windows Server 2008 kernel is actually the same as the Windows Vista SP1 kernel, which is why the first service pack for Server 2008 was called SP2. And Windows 7 and Server 2008 R2 not only use the same kernel, but you can even use the same service pack to upgrade both of them to SP1.
Source for Windows version Number.
http://msdn.microsoft.com/en-us/library/ms724832(v=vs.85).aspx
XP and 2003 server essentially come from the same world, with the minor version (in your case, the 2 or the 1) being the identifying factor between the two.
This is pretty accurate. The core code that makes Windows kernel tick is the same between XP and Windows 2003. This also happened later, Vista and Windows 2008 share the same core. And Win7 and Windows 2008 R2.
What's wrong with it? Most of the sources (kernel, shell, etc) are shared between client and server editions of Windows operating systems, the main differences are in additional software (e.g. AD server & co) and tweaks to the system components (e.g. longer scheduler quanta).
Windows 2003 server is mostly based on the XP codebase, with a year more of development (XP was born in 2002); that's the typical Windows server release schedule (1 year after the client operating system it's based on).
Trivia: you may notice that also the IA64 edition of Windows XP is 5.2, since it is based on the 2003 server codebase (because it was the "state of the art" Windows they had when they started working on IA64).
From MSDN
MajorRevision Gets the high 16 bits of the revision number. MinorRevision Gets the low 16 bits of the revision number.
The 3rd number is actually Version.Build. It can't be blank, it's a number.
I believe the MajorRevision refers to the service pack value.
There's a lot of information here, though the naming seems to be a little different.
精彩评论