windowsversion

Getting Windows OS version programmatically

六月ゝ 毕业季﹏ 提交于 2019-11-26 20:42:44
问题 I am trying to fetch Windows version with C# on my Windows 10 machine. I always get those values (with C#\C++): Major: 6 Minor: 2 Which is Windows 8 OS, accordingly to MSDN C# code: var major = OperatingSystem.Version.Major var minor = OperatingSystem.Version.Minor C++ code void print_os_info() { //http://stackoverflow.com/questions/1963992/check-windows-version OSVERSIONINFOW info; ZeroMemory(&info, sizeof(OSVERSIONINFOW)); info.dwOSVersionInfoSize = sizeof(OSVERSIONINFOW); LPOSVERSIONINFOW