For a Windows 8 application I’m building, I needed a way to uniquely identify a user’s device. The best option I found was using the HardwareIdentification value. The only problem it has is that it can change if your system hardware changes(but that’s good enough for me )
O yes, here is the code I used:
private string GetHardwareId()
{
var token = HardwareIdentification.GetPackageSpecificToken(null);
var hardwareId = token.Id;
var dataReader = Windows.Storage.Streams.DataReader.FromBuffer(hardwareId);
byte[] bytes = new byte[hardwareId.Length];
dataReader.ReadBytes(bytes);
return BitConverter.ToString(bytes);
}