How can I detect if my app is running on Windows 10

后端 未结 7 1384
清酒与你
清酒与你 2020-12-09 01:17

I\'m looking for a means to detect if my C# app is running on Windows 10.

I had hoped that Environment.OSVersion would do the trick, but this seems to r

7条回答
  •  猫巷女王i
    2020-12-09 01:52

    Can't you use the Version Helper functions? https://msdn.microsoft.com/en-us/library/windows/desktop/dn424972(v=vs.85).aspx

    IsWindows10OrGreater

    Indicates if the current OS version matches, or is greater than, the Windows 10 version. For Windows 10, IsWindows10OrGreater returns false unless the application contains a manifest that includes a compatibility section that contains the GUID that designates Windows 10.

    and add the GUIDs: https://msdn.microsoft.com/en-ca/library/windows/desktop/dn481241(v=vs.85).aspx

提交回复
热议问题