是否可以从我的应用中检测给定设备的Windows内部版本号?如果是这样,有人可以发布链接或告诉我该怎么做?
我正在尝试为只影响特定Insider版本的用户的错误部署快速解决方法。谢谢!
答案 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}";