Use .NET to detect Windows version
Question:
How to determine the Windows operating system version in a .NET application?
Answer:
To detect the Windows operating system version in .NET, you can use the System.Environment.OSVersion
attribute. It provides the following information:
Specific Windows version and its OSVersion value:
<code>| Windows版本 | PlatformID | 主要版本 | 次要版本 | |---|---|---|---| | Windows 95 | Win32Windows | 4 | 0 | | Windows 98 | Win32Windows | 4 | 10 | | Windows Me | Win32Windows | 4 | 90 | | Windows NT 4.0 | Win32NT | 4 | 0 | | Windows 2000 | Win32NT | 5 | 0 | | Windows XP | Win32NT | 5 | 1 | | Windows 2003 | Win32NT | 5 | 2 | | Windows Vista | Win32NT | 6 | 0 | | Windows 2008 | Win32NT | 6 | 0 | | Windows 7 | Win32NT | 6 | 1 | | Windows 2008 R2 | Win32NT | 6 | 1 | | Windows 8 | Win32NT | 6 | 2 | | Windows 8.1 | Win32NT | 6 | 3 | | Windows 10 | Win32NT | 10 | 0 |</code>
Note:
OSVersion
values for these versions. The above is the detailed content of How Can I Detect the Windows OS Version Using .NET?. For more information, please follow other related articles on the PHP Chinese website!