In doing WIN10 development, we may often need to get the current program on which platform device to run, for UI and related API calls, then how to know the current app running platform?
Today there are two ways to make a reference for everyone:
Method One: devicefamily
Through Windows.System.Profile.AnalyticsInfo.VersionInfo.DeviceFamily, to obtain the current platform equipment, currently only can get two values Windows.mobile or Windows.desktop, respectively, represents the hand Machine and PC (tablet)
(Of course, you may not be windows.watch or windows.television.)
This method is relatively simple, recommended, please note that if you add the Microsoft Mobile Extension SDK for Universal App platform Reference, call some of Mobile's proprietary API, Make sure to make a system decision before calling the API, otherwise you will be on your PC (the lesson of blood)
method Two: Through the Easclientdeviceinformation class
The current system character can be obtained from the following code
String result = Easclientdeviceinformation.operatingsystem;
Turn to Original
[Go]---How the UWP determines which platform device the current app is running on