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

Stats

9.9K 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)

Share

About the Author

The_Mega_ZZTer
United States United States
No Biography provided

Comments and Discussions

 
-- There are no messages in this forum --