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

Source: Internet
Author: User


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


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.