How do I find DeviceuniqueID in Windows phone 8 using c#?

vivekwindowsphone

New member
Jul 7, 2015
4
0
0
hi i m using this code .,..
object uniqueId;
byte[] DeviceIDbyte = null;

if (DeviceExtendedProperties.TryGetValue("uniqueId", out uniqueId))
{
DeviceIDbyte = (byte[])uniqueid;
string deviceid = Convert.ToBase64String(DeviceIDbyte);
MessageBox.Show(deviceid);
}

but notfind the device unique id bcz if() cindition is not true always falls
plz help

how to find DeviceuniqueID ..
 
In Windows Phone 8.1, I get the Phone Unique Id like this :

private static string GetDeviceID()
{
HardwareToken token = HardwareIdentification.GetPackageSpecificToken(null);
IBuffer hardwareId = token.Id;

HashAlgorithmProvider hasher = HashAlgorithmProvider.OpenAlgorithm("MD5");
IBuffer hashed = hasher.HashData(hardwareId);

string hashedString = CryptographicBuffer.EncodeToHexString(hashed);
return hashedString;
}

I don't know if this code compile in WP 8.0 but maybe it can help you...
 
Always used the same since WP7:
var value = (byte[])DeviceExtendedProperties.GetValue("DeviceUniqueId");
 

Members online

Forum statistics

Threads
339,462
Messages
2,262,484
Members
428,759
Latest member
jekkylords