求助,关于获取客户端MAC地址的办法? 因工作的要求,要写一个程序,就是访问一个网站(服务器)然后进行登陆操作在登陆验证的时候 去获取访问者机器的MAC地址 然后查询服务器数据库是否存在这个MAC地址,来验证这个机器是否可以登陆在网上也搜索了很久没有找到符合条件的,求助中。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <html xmlns="http://www.w3.org/1999/xhtml" > <head > <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 type="text/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; } </script> <script type="text/jscript"> var service = locator.ConnectServer(); var MACAddr ; service.Security_.ImpersonationLevel=3; service.InstancesOfAsync(foo, 'Win32_NetworkAdapterConfiguration'); </script> <script type="text/jscript" event="OnCompleted(hResult,pErrorObject,pAsyncContext)" for="foo" > document.form1.TextBox1.value=unescape(MACAddr); </script> <title>无标题页 </title> </head> <body> <form id="form1" runat="server"> <div> 获得MAC:<asp:TextBox ID="TextBox1" runat="server"> </asp:TextBox> <br /> </div> </form> </body> </html>直接拷贝运行!! http://hi.baidu.com/hubblebubblepig/blog/item/ca2ca5a161ea9b8e46106449.htmlhttp://topic.csdn.net/t/20040415/12/2968211.html第二个链接解决了 我也在网上找了很多方法,不过都不能解决问题方法1:ManagementClass mc = new ManagementClass("Win32_NetworkAdapterConfiguration");这个只是取得服务器的MAC地址方法2: [DllImport("Iphlpapi.dll")] public static extern int SendARP(Int32 dest, Int32 host, ref Int64 mac, ref Int32 length); [DllImport("Ws2_32.dll")] public static extern Int32 inet_addr(string ip);只能作用在局域网内,或者说是如果是通过外网访问的话就失效方法3:就是使用IE中的一个特有控件,而且必须使用JScript编写最大的问题就是,如果客户不是使用IE就取不到,再就是设置控件对安全性比较大 还有个问题,2楼的朋友就是我上面说的第3个方法如果适用IE7运行的话,只能在IE设置里去吧ActiveX控件都去启用 楼主,方法就是你说的那些方法,也就是说:除了ActiveX控件(系统自带的,或自己开发的,都一样)没其它的办法。所以你不要再考虑了。 这个问题我这边都是要求客户使用一个小的cs登陆器;通过登陆器获取客户端的mac,再调用webservice传递mac地址的 ActiveX之类的插件http://topic.csdn.net/u/20090617/11/8f0432b6-84ee-49da-a55f-86b3d343ab8b.html 请问用.Net 开发B2C网站需要什么技术 批量添加数据,类目联动如何解决? Gridview CheckBox 栏的问题(单选) 关于 如果有 两组 动态添加控件,发布信息时,如何能分辩每组的文件类别的问题,详情请进! 新手问题,数据库连接出错 DataGrid无刷新查询怎么做呀,谢谢各位了 如何在网页中嵌入visio实现在线编辑,并将结果保存到服务端? 要做个上传,下载视频文件的功能,还要可以在线观看,请大家帮忙? 用三层架构的大神帮帮忙C#语言 DataGrid中的链接列如何加参数? 用什么方法可以把web.config的数据库连接保护好? 数据库中包含字符串判断
<head >
<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 type="text/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;
}
</script>
<script type="text/jscript">
var service = locator.ConnectServer();
var MACAddr ;
service.Security_.ImpersonationLevel=3;
service.InstancesOfAsync(foo, 'Win32_NetworkAdapterConfiguration');
</script> <script type="text/jscript" event="OnCompleted(hResult,pErrorObject,pAsyncContext)" for="foo" >
document.form1.TextBox1.value=unescape(MACAddr);
</script> <title>无标题页 </title>
</head>
<body>
<form id="form1" runat="server">
<div> 获得MAC:<asp:TextBox ID="TextBox1" runat="server"> </asp:TextBox>
<br />
</div>
</form>
</body> </html>
直接拷贝运行!!
方法1:
ManagementClass mc = new ManagementClass("Win32_NetworkAdapterConfiguration");
这个只是取得服务器的MAC地址
方法2:
[DllImport("Iphlpapi.dll")]
public static extern int SendARP(Int32 dest, Int32 host, ref Int64 mac, ref Int32 length);
[DllImport("Ws2_32.dll")]
public static extern Int32 inet_addr(string ip);
只能作用在局域网内,或者说是如果是通过外网访问的话就失效
方法3:
就是使用IE中的一个特有控件,而且必须使用JScript编写
最大的问题就是,如果客户不是使用IE就取不到,再就是设置控件对安全性比较大
如果适用IE7运行的话,只能在IE设置里去吧ActiveX控件都去启用
没其它的办法。所以你不要再考虑了。
通过登陆器获取客户端的mac,再调用webservice传递mac地址的
http://topic.csdn.net/u/20090617/11/8f0432b6-84ee-49da-a55f-86b3d343ab8b.html