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

Windows phone 7 获取windows phone 7唯一标识符的正确方法是什么?,windows-phone-7,windows-phone-7.1,Windows Phone 7,Windows Phone 7.1,目前我正在使用以下方法。我不确定这是否是正确的方法来识别每个独特的手机不需要有相同的sim卡。android有一款imei手机 public static String GetDeviceUniqueID() { object DeviceUniqueID; byte[] DeviceIDbyte = null; if (DeviceExtendedProperties.TryGetValue("DeviceUniqueId", o

目前我正在使用以下方法。我不确定这是否是正确的方法来识别每个独特的手机不需要有相同的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;
    }  

这似乎是我迄今为止读过的资料中建议的方法。

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

不要忘记在WMAppManifest.xml中包含必要的值。如果找不到,将出现如下URL中所述的异常