2016-07-25 31 views
0

是否可以從我的應用程序檢測給定設備的窗口內部編號?如果是的話,有人可以發佈一個鏈接或告訴我該怎麼做?在UWP中檢測Windows內部人員構建?

我想部署一個快速的解決方法,只對特定的內部人員構建影響用戶的錯誤。謝謝!

+0

你嘗試檢查Environment.OSVersion? – Will

+1

UWP SDK中不存在Environment.OSVersion。我發現這個雖然,它看起來像它在我的盒子上工作:http://stackoverflow.com/a/31895625/2646868 –

+0

@AdamVenezia是正確的,我只是偶然找到一個類似的答案,因爲你亞當。謝謝。 – RoboLam

回答

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