转自:http://linzr33.blog.163.com/blog/static/57380282013108113827209/
How to Get Unique Device ID from Windows Phone Using C#?
// get the unique device id for the publisher per device private void mGetDeviceUniqueId() { byte[] result = null; object uniqueId; if (Microsoft.Phone.Info.DeviceExtendedProperties.TryGetValue("DeviceUniqueId", out uniqueId)) { result = (byte[])uniqueId; } //转换设备ID为字符串 if (result != null) { AppSetting.getDeviceUniqueId = Convert.ToBase64String(result); } }
Note that , in Windows Phone 8 , you need to enable the “ID_CAP_IDENTITY_DEVICE” capability in your windows phone app manifest file for the above code snippet to work.