Click here to Skip to main content
15,565,474 members
Articles / Programming Languages / C#
Alternative
Tip/Trick
Posted 5 Aug 2011

Stats

10.4K views
2 bookmarked

32-Bit or 64-bit OS ??

Rate me:
Please Sign up or sign in to vote.
0.00/5 (No votes)
5 Aug 2011CPOL
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)


Written By
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
-- There are no messages in this forum --