How can I convert the result of the GetUniqueId function to a string?
DeviceInformation.GetUniqueId()
How can I convert the result of the GetUniqueId function to a string?
DeviceInformation.GetUniqueId()
var uni = DeviceInformation.GetUniqueId();
var stru = "";
for (var i = 0; i < uni.Length; i++)
{
stru += uni[i].ToString("x2") + " ";
}
Debug.WriteLine("uni :" + stru);
I thought there was a one line way.
Thanks for the snippet.
You can put all of them in one line :))).
You can use BitConverter.ToString
var id = DeviceInformation.GetUniqueId();
Trace.WriteLine(BitConverter.ToString(id));
Perfect. That 's what I was looking for. Thank you!