问题
On Windows Phone 7 you can do like this to get an anonymous unique id for the current user.
UserExtendedProperties.GetValue("ANID")
I have search for a while to find an equivalent for my current Windows 8 (WinRT), but I can't seem to find it. All the results I find, talks about how to get a Hardware/device specific ID, which IS supported, it's just not what I need.
Thanks in advance, Mads
回答1:
Found out, thanks to xamlgeek an others, that it's not possible to get a Unique User Id in Windows 8 - at least for now.
So I have to fallback on Device Id, which is far from what I needed, but found this code snippet with works perfect (C#):
http://bartwullems.blogspot.co.uk/2012/09/windows-8-uniquely-identifying-device.html
回答2:
The answer is not good at all, because the user can upgrade his PC config (by pluging a bluetooth adapter or anything else). The good answer is to use the object :
Windows.Storage.ApplicationData.Current.RoamingSettings.Values["HighPriority"]
It's synchronized through the different installation of the apps on the cloud, more infos here : The HighPriority key is special because it's get automatically during the new installation of the app.
http://blogs.msdn.com/b/windowsappdev/archive/2012/07/17/roaming-your-app-data.aspx
回答3:
It's unwise to use GetPackageSpecificToken. This ID will change even if user just plug USB device into his PC/tab, or turn Wifi on/off. Actually it's a quite unstable thing, no idea why MSFT has ever made it.
I use LiveConnect instead (only Liveconnect user ID is needed and it's the same on all user devices). It much more reliable. See my post here: https://stackoverflow.com/a/22389679/1656824
来源:https://stackoverflow.com/questions/14779614/userextendedproperties-getvalueanid-equivalent-on-windows-8