string strDeviceUniqueId = "";
string strSignature = "";
string strCertificate = "";
var token = HardwareIdentification.GetPackageSpecificToken(null);
IBuffer hardwareId = token.Id;
IBuffer signature = token.Signature;
IBuffer certificate = token.Certificate;
var byteArray = new byte[hardwareId.Length];
var dataReader = DataReader.FromBuffer(hardwareId);
dataReader.ReadBytes(byteArray);
foreach (byte b in byteArray)
{
string strTemp = b.ToString();
if (1 == strTemp.Length)
{
strTemp = "00" + strTemp;
}
else if (2 == strTemp.Length)
{
strTemp = "0" + strTemp;
}
strDeviceUniqueId += strTemp;
}
It is important to note that Ashwid is user-consistent, unique per device, per application. That is, the same user on different devices using the same app to obtain a different Ashwid value, the same user on the same device using different apps to get Ashwid value is also different.
For more details on Ashwid and implementing logic for each device, refer to the article I wrote earlier, "several scenarios where the Windows store app obtains device IDs."
Mobile network Information
AWindows.Networking.NetworkOperatorsnumber of mobile network-related APIs are defined in the namespace. For exampleMobileBroadbandAccount, the class represents a mobile broadband account, the ' Mobilebroadbandnetwork ' class represents a mobile broadband network, and so on. All feature features provided under this namespace belong to the Microsoft partner API. This means that developers need to get specific private permissions from Microsoft to invoke these APIs in the app and work properly. Since I am not a mobile phone manufacturer, I am not a mobile network worker, I cannot get the authorization of these private rights, and most of the developers will not get it, so I will not repeat this namespace-related API here, just give reference, interested friends can refer to:
- Mobile Broadband Overview
- Mobile Broadband WinRT API Overview
- List of Mobile broadband Windows Runtime APIs
- Best practices for using Mobile Broadband Windows Runtime API
UWP apps get all kinds of systems, user information The second article ends here. Follow-up as you learn more about the UWP APIs, I'll continue to update this series of articles and sample code to demonstrate how to get common information.
UWP apps get all kinds of systems, user information (2)-Store authorization information, retail demo mode information, ad ID, EAS device information, hardware identification information, mobile network information