如何在ASP.Net中获取客户端计算机标识符?
谁能告诉我在asp.net/javascript中我是否可以获得客户端计算机标识符? (客户端是在网络不是本地Intranet)的如何在ASP.Net中获取客户端计算机标识符?
(什么是客户端计算机indentifier我认为,如:客户端计算机MAC地址或者任何硬件GUID(如CPU,网卡等)?)
或者是否有任何simplelitify方法在HTML5中执行它?
或者我是否可以通过ActiveX获取客户端计算机标识符? (我怎样才能使用ActiveX,任何人谁可以给我一些参考,如果activeX可以使用C#构建是很好的。)
(这是一个业务系统,并且客户批准我们让他们的客户端计算机硬件标识符,所以我怎么能在asp.net中做到这一点?)
尝试下面的脚本,它可能需要用户身份验证来运行ActiveX和ActiveX,据我所知只能在IE中使用。
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title></title>
<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
<meta name="vs_targetSchema" content="http://schemas.
microsoft.com/intellisense/ie5">
<script id="clientEventHandlersJS" language="javascript">
<!--
function Button1_onclick() {
var locator = new ActiveXObject("WbemScripting.SWbemLocator");
var service = locator.ConnectServer(".");
var properties = service.ExecQuery("SELECT * FROM Win32_NetworkAdapterConfiguration");
var e = new Enumerator (properties);
document.write("<table border=1>");
dispHeading();
for (;!e.atEnd();e.moveNext())
{
var p = e.item();
document.write("<tr>");
document.write("<td>" + p.Caption + "</td>");
document.write("<td>" + p.IPFilterSecurityEnabled + "</td>");
document.write("<td>" + p.IPPortSecurityEnabled + "</td>");
document.write("<td>" + p.IPXAddress + "</td>");
document.write("<td>" + p.IPXEnabled + "</td>");
document.write("<td>" + p.IPXNetworkNumber + "</td>");
document.write("<td>" + p.MACAddress + "</td>");
document.write("<td>" + p.WINSPrimaryServer + "</td>");
document.write("<td>" + p.WINSSecondaryServer + "</td>");
document.write("</tr>");
}
document.write("</table>");
}
function dispHeading()
{
document.write("<thead>");
document.write("<td>Caption</td>");
document.write("<td>IPFilterSecurityEnabled</td>");
document.write("<td>IPPortSecurityEnabled</td>");
document.write("<td>IPXAddress</td>");
document.write("<td>IPXEnabled</td>");
document.write("<td>IPXNetworkNumber</td>");
document.write("<td>MACAddress</td>");
document.write("<td>WINSPrimaryServer</td>");
document.write("<td>WINSSecondaryServer</td>");
document.write("</thead>");
}
//-->
</script>
</head>
<body>
<INPUT id="Button1" type="button" value="Button"
name="Button1" language="javascript" onclick="return Button1_onclick()">
</body>
</html>
喜在本地网络上的客户端计算机的名称,感谢您的申请,当我复制上面的代码到记事本,并保存为“ index.html“,然后在IE9中打开它,点击页面上的按钮后,页面上只显示一个js错误信息:Error:Object expected – 2012-04-18 03:42:09
你可能会关闭activex – 2012-04-18 04:10:43
SORRY不知何故错过了父级更新现在试试 – 2012-04-18 04:26:26
我觉得实际上是一种方式来获得,只有当它使用DNS – 2012-04-18 03:03:41