什么是正确的方式来获得Windows Phone 7的唯一标识符?

问题描述:

目前我正在使用以下方法。我不确定这是否是识别每个独特手机的正确方式(不需要具有相同的SIM卡)。为Android有一个IMEI的手机什么是正确的方式来获得Windows Phone 7的唯一标识符?

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

是的,这是获得唯一设备标识符的唯一途径...

Downt忘记在WMAppManifest.xml必要的值。如果找不到,则会出现如下URL中所述的例外...

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

这似乎是从我已经阅读最新的东西,建议的方式。