我需要找出一种方法来唯一地识别访问我正在创建的网站的每台计算机.有没有人对如何实现这一点有任何建议?
因为我希望解决方案适用于所有机器和所有浏览器(在合理范围内),我正在尝试使用javascript创建解决方案.
我很感激帮助.谢谢.
编辑:
Cookies不行.
假设计算机没有发生硬件更改,我需要能够基本上创建一个计算机独有的guid并且可重复.我正在考虑的方向是获取网卡的MAC和这种性质的其他信息,这将是访问该网站的机器.
我们使用以下代码检索Windows PC的活动MAC地址.
private static string macId()
{
return identifier("Win32_NetworkAdapterConfiguration", "MACAddress", "IPEnabled");
}
private static string identifier(string wmiClass, string wmiProperty, string wmiMustBeTrue)
{
string result = "";
System.Management.ManagementClass mc = new System.Management.ManagementClass(wmiClass);
System.Management.ManagementObjectCollection moc = mc.GetInstances();
foreach (System.Management.ManagementObject mo in moc)
{
if (mo[wmiMustBeTrue].ToString() == "True")
{
//Only get the first one
if (result == "")
{
try
{
result = mo[wmiProperty].ToString();
break;
}
catch
{
}
}
}
}
return result;
}
//Return a hardware identifier
private static string identifier(string …Run Code Online (Sandbox Code Playgroud)