Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / Languages / C#

32-Bit or 64-bit OS ??

0.00/5 (No votes)
5 Aug 2011CPOL 11.2K  
Version check is wrong. It happens to work correctly only because no minor versions of Windows 5 were released after 5.1 (AFAIK... are Windows Server 2003 and Embedded XP and Media Center XP still 5.1?). A theoretical version 5.2 would fail the check. I submit the following...
Version check is wrong. It happens to work correctly only because no minor versions of Windows 5 were released after 5.1 (AFAIK... are Windows Server 2003 and Embedded XP and Media Center XP still 5.1?). A theoretical version 5.2 would fail the check. I submit the following fix:

C
if(System.Environment.OSVersion.Version.Major > 5 ||
(System.Environment.OSVersion.Version.Major >= 5 && System.Environment.OSVersion.Version.Minor >= 1))

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)