when trying to get imei number null exception occurs. when running in windows phone emulator.
//Please check this
object uniqueId;
var hexString = string.Empty;
if (DeviceExtendedProperties.TryGetValue("DeviceUniqueId", out uniqueId))
hexString = BitConverter.ToString((byte[])uniqueId).Replace("-", string.Empty);
MessageBox.Show("myDeviceID:" + hexString);
我有这个问题,返回null值。
In WMAppManifest.xml -> Capabilities tab -> switch on ID_CAP_IDENTITY_DEVICE
在此链接中,他使用GetValue
而不是TryGetValue
及其工作: 在Windows Phone 8下获取唯一设备ID(UDID)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.