What is the right way to get Unique Identifier of windows phone 7?

笑着哭i 提交于 2019-12-09 21:53:43

问题


Currently i am using the following methods. I am not sure if this is the correct way to identify each unique phone (doesn't need to have same sim card). For android there is a imei phone

  public static String GetDeviceUniqueID()
    {
        object DeviceUniqueID;

        byte[] DeviceIDbyte = null;

        if (DeviceExtendedProperties.TryGetValue("DeviceUniqueId", out DeviceUniqueID))

            DeviceIDbyte = (byte[])DeviceUniqueID;

        string DeviceID = Convert.ToBase64String(DeviceIDbyte);

        return DeviceID;
    }  

回答1:


Yes , it is the only way to get the unique device identifier ...

Downt forget to include the necessary value in WMAppManifest.xml . If it is not found , there will be an exception as described in the below URL...

http://www.ginktage.com/2011/05/how-to-get-the-uniqueid-of-the-windows-phone-device-using-c/




回答2:


That seems to be the suggested way from the stuff that I have read to date.



来源:https://stackoverflow.com/questions/8524435/what-is-the-right-way-to-get-unique-identifier-of-windows-phone-7

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!