在UWP中检测Windows Insider内部版本?

时间:2016-07-25 17:03:27

标签: c# uwp

是否可以从我的应用中检测给定设备的Windows内部版本号?如果是这样,有人可以发布链接或告诉我该怎么做?

我正在尝试为只影响特定Insider版本的用户的错误部署快速解决方法。谢谢!

1 个答案:

答案 0 :(得分:2)

找到答案:

string deviceFamilyVersion = AnalyticsInfo.VersionInfo.DeviceFamilyVersion;
    ulong version = ulong.Parse(deviceFamilyVersion);
    ulong major = (version & 0xFFFF000000000000L) >> 48;
    ulong minor = (version & 0x0000FFFF00000000L) >> 32;
    ulong build = (version & 0x00000000FFFF0000L) >> 16;
    ulong revision = (version & 0x000000000000FFFFL);
    var osVersion = $"{major}.{minor}.{build}.{revision}";

https://social.msdn.microsoft.com/Forums/en-US/2d8a7dab-1bad-4405-b70d-768e4cb2af96/uwp-get-os-version-in-an-uwp-app?forum=wpdevelop