[英]Banning By Mobile Device?
我正在制作一些主要由用户驱动的应用程序,当然这意味着他们将成为麻烦制造者,他们可能会使用咒骂词输入虚假数据,或者更糟糕的是将有效数据更改为不良数据(即改为发誓的话)
当然会采取措施来遏制这种情况,但最终我希望可以选择禁止某人申请。
我首先想到的是通过电子邮件地址禁止他们的帐户 我也在想,也许最重要的是禁止他们的设备。
我的问题是,如果他们使用,我可以在手机上使用哪个唯一ID
Andriod
Iphone
Blackberry
Windows Phone 7/8
它有多独特? 它可以轻易改变吗?
对于Windows Phone,您应该能够使用DeviceExtendedProperties 。 特别是DeviceUniqueId
属性。
请注意,尽管如此,正如他们在该文章中所说,如果您使用设备ID禁止用户,那么同一设备的任何未来用户都将被禁止访问您的应用,即使他们没有做错任何事情。
有2个标识符可以一起用于标识特定设备和用户。
DeviceUniqueId和WindowsLiveAnonymousId
第一个是设备,如上所述,任何在被禁用户之后使用该设备的人也将被禁止。
WindowsLiveAnonymousId对用户是唯一的。 我在3个独立的设备上看到了相同的标识符,对于用户LiveId,它总是相同的。
我使用以下两种方法来获取这些ID以识别领导者的游戏玩家:
//Note: to get a result requires ID_CAP_IDENTITY_DEVICE
// to be added to the capabilities of the WMAppManifest
// this will then warn users in marketplace
public static byte[] GetDeviceUniqueId()
{
byte[] result = null;
object uniqueId;
if (DeviceExtendedProperties.TryGetValue("DeviceUniqueId", out uniqueId))
result = (byte[])uniqueId;
return result;
}
// NOTE: to get a result requires ID_CAP_IDENTITY_USER
// to be added to the capabilities of the WMAppManifest
// this will then warn users in marketplace
public static string GetWindowsLiveAnonymousId()
{
string result = String.Empty;
object anid;
if (UserExtendedProperties.TryGetValue("ANID", out anid))
{
if (anid != null && anid.ToString().Length >= (AnidLength + AnidOffset))
{
result = anid.ToString().Substring(AnidOffset, AnidLength);
}
}
return result;
}
他们这样使用:
string deviceUniqueId = String.Empty;
for (int i = 0; i < GetDeviceUniqueId().GetLength(0); i++)
{
deviceUniqueId += GetDeviceUniqueId().GetValue(i);
}
DeviceUniqueIDTextBlock.Text = deviceUniqueId;
WindowsLiveAnonymousIDTextBlock.Text = GetWindowsLiveAnonymousId().ToString(CultureInfo.InvariantCulture);
去年五月我做了一篇关于获取WP7系统信息的帖子。 此代码可在此处找到: http : //www.adambenoit.com/applications/system-info-windows-phone/
希望这可以帮助。
所有这些设备都具有唯一MAC地址的网络接口,根据定义,这些MAC地址是固定的 - MAC地址被烧录到硬件中并且不能[轻易]欺骗,特别是在移动设备上。 我会哈希MAC地址并将其用作密钥。 苹果禁止使用UDID,这是iOS上很常见的做法。
我会使用guid方法。 虽然可以通过卸载和重新安装应用程序来规避这一点。 虽然没有完美
如何在Windows Phone上创建GUID http://msdn.microsoft.com/en-us/library/system.guid.newguid(v=vs.95).aspx
如何在Blackberry上创建GUID http://supportforums.blackberry.com/t5/Java-Development/how-to-generate-GUID/td-p/289947
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.