Since few days I am trying to get MAC Adress from my Windows Phone device withouse success. I am trying to get UNIQUE ID for my Phone, Tablet etc. I`ve found HardwareToken class and the code below
HardwareToken token = HardwareIdentification.GetPackageSpecificToken(null);
IBuffer hardwareId = token.Id;
HashAlgorithmProvider hasher = HashAlgorithmProvider.OpenAlgorithm("MD5");
IBuffer hashed = hasher.HashData(hardwareId);
string hashedString = CryptographicBuffer.EncodeToHexString(hashed);
Using this code I am reciving ASHWID. Is that really unique?
the ASHWID is qualified as sufficiently unique. You can rely on it IMHO. Check this reference article to get deep knowledge on the ASHWID https://msdn.microsoft.com/en-us/jj553431
It depends. On phone/tablet more likely than on desktop. The exact answer you can found at MSDN:
Following Peter's Torr answer you should also check first if that API is present on actual device. Though you may also think about his advice - to think if that really is a solution to your problem.