如何在Windows Phone 8.1中获取设备唯一标识?使用DeviceExtendedProperties.GetValue("DeviceUniqueId")
的旧方法不适用于Windows Universal应用程序。
如何在Windows Phone 8.1中获取设备唯一标识?使用DeviceExtendedProperties.GetValue("DeviceUniqueId")
的旧方法不适用于Windows Universal应用程序。
private 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;
}
希望这能帮到你!HardwareToken myToken = HardwareIdentification.GetPackageSpecificToken(null);
IBuffer hardwareId = myToken.Id;
HardwareIdentification.GetPackageSpecificToken
依赖于包的ID/名称。是否有其他ID在同一设备上安装的所有应用程序中都相同? - Kinjan Bhavsar