几天以来,我尝试从我的 Windows Phone 设备获取 MAC 地址,但没有成功。我正在尝试为我的手机、平板电脑等获取唯一 ID。我找到了 HardwareToken 类和下面的代码
HardwareToken token = HardwareIdentification.GetPackageSpecificToken(null);
IBuffer hardwareId = token.Id;
HashAlgorithmProvider hasher = HashAlgorithmProvider.OpenAlgorithm("MD5");
IBuffer hashed = hasher.HashData(hardwareId);
string hashedString = CryptographicBuffer.EncodeToHexString(hashed);
使用此代码我正在接收ASHWID。这真的很独特吗?
最佳答案
Using this code I am receiving ASHWID. Is that really unique?
这要看情况。在手机/平板电脑上比在桌面上更有可能。确切答案你可以找到at MSDN :
The ASHWID provides a strong binding between the app/package and the device by representing several individual hardware characteristics. In order to protect user privacy, the ASHWID varies from app to app. Unless the underlying hardware has changed, two calls from the same app will result in identical ASHWIDs. However, the ASHWID changes if the hardware profile of the device changes, such as when the user unplugs a USB Bluetooth adapter. The back-end cloud service can verify the ASHWID and compare it with previously reported values.
已关注 Peter's Torr answer您还应该首先检查实际设备上是否存在该 API。尽管您也可以考虑他的建议 - 思考这是否真的能解决您的问题。
关于c# - 唯一设备 ID UWP,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34153786/