wp8 入门到精通 虚拟标示符 设备ID

//获得设备虚拟标示符 wp8

public string GetWindowsLiveAnonymousID()
{
object anid = new object();
string anonymousUserId = "";
try
{
if (UserExtendedProperties.TryGetValue("ANID2", out anid))
{
if (null == anid)
{
return string.Empty;
}
anonymousUserId = anid as string;
anonymousUserId = anonymousUserId.Substring(2, 32);
}
}
catch (Exception)
{
}
return anonymousUserId;
}

//获得设备id

//注意 同一个App在同一个手机使用设备Id相同 (包括重复卸载,更新)

//      不同的App在同一个手机使用设备Id不同  我觉得设备ID是绑定App的

public string GetDeviceId()
{
byte[] uniqueId = (byte[])DeviceExtendedProperties.GetValue("DeviceUniqueId");
string uinid = BitConverter.ToString(uniqueId);
System.Diagnostics.Debug.WriteLine(GetDeviceId());
return uinid.Replace("-", "");

}

同时加上两个能力

ID_CAP_IDENTITY_DEVICE

ID_CAP_IDENTITY_USER

用户名和邮箱是可以获取的 但是必须是越狱的手机 通过访问注册表获取 而且还可以修改liveID

越狱手机有:三星的那款WP8手机 华为W1

Windows Phone 的应用清单文件

原文地址:https://www.cnblogs.com/luquanmingren/p/3802642.html