I am trying to play with the Environment.OSVersion.Version
object and can't really tell what version would indicate that the OS is Windows XP or higher (e.g. I want to exclude Windows 2000, ME or previous versions).
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Generic Generics in Managed C++
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
Use the
System.OperatingSystem
object, then filter on the Major & Minor version numbers.I've used these functions in the past:
Check the
Major
property is greater than or equal to 5, and if 5 thenMinor
is at least 1. (XP was 5.1, 2003 was 5.2, Vista/2008 were 6.0).List of Windows Version Numbers on MSDN.
You shouldn't check the version number. Instead, you should check for the functionality you need. If it is a specific API you're after for example, LoadLibrary and GetProcAddress it - that way, you're not dependent on the version number.