Jerry Nixon @Work: How to uniquely identify a device in WinRT?

Jerry Nixon on Windows

Thursday, August 16, 2012

How to uniquely identify a device in WinRT?

imageThis is a nice trick that has been introduced in RTM. Why do you want to identify a device? Because you might be syndicating content or data from your services to a device or devices and you want to partition based on what is already present (sort of like TFS workspaces) or you want to save bandwidth or some other clever thing you think of.

Here’s how you do it:

var _Token = Windows.System.Profile
 .HardwareIdentification.GetPackageSpecificToken(null);

That’s it. Without this feature, some scenarios are just plain impossible. Now, go forth and develop. But to be fair, I need to give credit where credit is due – this guy posted the answer before I could and the fastest draw deserves a nod, here.

Best of luck!