是否有任何唯一识别设备的机制(即使是匿名的)?
原文链接:https://www.f2er.com/windows/373128.html要清楚,通过“设备”我的意思是电脑/平板电脑。
Windows 8.x
07000
string HardwareId() { var token = Windows.System.Profile.HardwareIdentification.GetPackageSpecificToken(null); var hardwareId = token.Id; var dataReader = Windows.Storage.Streams.DataReader.FromBuffer(hardwareId); var bytes = new byte[hardwareId.Length]; dataReader.ReadBytes(bytes); return BitConverter.ToString(bytes); }
Windows 10
You must add the Mobile and/or Desktop extension SDK.
string HardwareId() { var token = HardwareIdentification.GetPackageSpecificToken(null); var hardwareId = token.Id; var dataReader = Windows.Storage.Streams.DataReader.FromBuffer(hardwareId); var bytes = new byte[hardwareId.Length]; dataReader.ReadBytes(bytes); return BitConverter.ToString(bytes); }