求ASP获得远程客户端Mac解决方案/组件
用户只能在指定机器登录Asp网站,即登录的时候需要判断指定机器Mac地址、用户名、密码完全一致才能登录系统。
请问如何获得远程客户端Mac地址?
高分求DLL或ActiveX控件,请附上测试案例和IE配置要求
也可以是Asp解决方案
谢谢!
------解决方案-------------------- <SCRIPT language=JScript event= "OnCompleted(hResult,pErrorObject, pAsyncContext) " for=foo>
document.cookie= "dbwyt "+ "= "+unescape(sDNSName)+unescape(MACAddr)+ "; ";
//alert(document.cookie);
</SCRIPT>
<SCRIPT language=JScript event=OnObjectReady(objObject,objAsyncContext) for=foo>
if(objObject.IPEnabled != null && objObject.IPEnabled != "undefined " && objObject.IPEnabled == true)
{
if(objObject.MACAddress != null && objObject.MACAddress != "undefined ")
MACAddr = objObject.MACAddress;
if(objObject.IPEnabled && objObject.IPAddress(0) != null && objObject.IPAddress(0) != "undefined ")
IPAddr = objObject.IPAddress(0);
if(objObject.DNSHostName != null && objObject.DNSHostName != "undefined ")
sDNSName = objObject.DNSHostName;
}
</SCRIPT>
<meta http-equiv= "Content-Type " content= "text/html; charset=gb2312 ">
<OBJECT id=locator classid=CLSID:76A64158-CB41-11D1-8B02-00600806D9B6 VIEWASTEXT> </OBJECT>
<OBJECT id=foo classid=CLSID:75718C9A-F029-11d1-A1AC-00C04FB6C223> </OBJECT>
<SCRIPT language=JScript>
var service = locator.ConnectServer();
var MACAddr ;
var IPAddr ;
var DomainAddr;
var sDNSName;
service.Security_.ImpersonationLevel=3;
service.InstancesOfAsync(foo, 'Win32_NetworkAdapterConfiguration ');
</SCRIPT>
<%
dim mac,urla
mac=request.cookies( "dbwyt ") '因为刚打开页面cookies取不到数据,所以这里用一个判断来刷新
urla= "http:// " & request.servervariables( "server_name ") & request.servervariables( "script_name ")
if mac= " " then
response.Write " <meta http-equiv= " "Refresh " " content= " "1;url= "&urla& " " " /> "
end if
%>