获取Windows Phone 7唯一标识符的正确方法是什么?

时间:2011-12-15 17:49:53

标签: windows-phone-7 windows-phone-7.1

目前我正在使用以下方法。我不确定这是否是识别每个独特手机的正确方法(不需要使用相同的SIM卡)。对于Android有一个imei手机

  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;
    }  

2 个答案:

答案 0 :(得分:3)

是的,这是获取唯一设备标识符的唯一方法......

Downt忘记在WMAppManifest.xml中包含必要的值。如果找不到,则会出现以下URL中描述的异常...

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

答案 1 :(得分:2)

这似乎是我迄今为止阅读的内容的建议方式。