[求助]关于客户端获取mac地址

dayanmao 2005-06-27 09:34:51
我使用了jaron提供的组件,(下载地址:http://www.jaron.cn/getmac.htm)现在可以正确显示客户端的MAC地址了,请问,如何修改能将此mac地址再发送到服务器端,我想将访问者的mac地址存入到数据库中。
不知道从何下手~请高手指点~
...全文
244 14 打赏 收藏 转发到动态 举报
写回复
用AI写文章
14 条回复
切换为时间正序
请发表友善的回复…
发表回复
dayanmao 2005-06-30
  • 打赏
  • 举报
回复
谢谢各位~
yangzixp 2005-06-28
  • 打赏
  • 举报
回复
OCX+javascript+隐藏域,没其他办法了
白夜花寒 2005-06-28
  • 打赏
  • 举报
回复
资料很简单你自己做ocx的,可以查一些api的资料,api的资料我有,还有我有你的qq
dayanmao 2005-06-28
  • 打赏
  • 举报
回复
白夜花寒(远藤花已谢,白夜花未寒) ~

是啊,我还在苏州工作啊~呵呵,我找了不少资料,都不能用啊~
如果你有实现的方法的话,和我联系吧~QQ:37193804 MSN:cn_tlz@hotmail.com


剑锋冷月(3G时代)(www.3gww.com/bbs)(www.e8page.com)

你的方法我用过了,通过代理和路由就不行了~谢谢
剑锋冷月 2005-06-28
  • 打赏
  • 举报
回复
<%@ LANGUAGE="VBSCRIPT"%>
<%
strIP = Request.ServerVariables("REMOTE_ADDR")
strMac = GetMACAddress(strIP)
strHost = Request.ServerVariables("REMOTE_HOST")

Function GetMACAddress(strIP)
Set net = Server.CreateObject("wscript.network")
Set sh = Server.CreateObject("wscript.shell")
sh.run "%comspec% /c nbtstat -A " & strIP & "> c:\" & strIP & ".txt ",0,true
Set sh = nothing
Set fso = createobject("scripting.filesystemobject")
Set ts = fso.opentextfile("c:\" & strIP & ".txt")
macaddress = null
Do While Not ts.AtEndOfStream
data = ucase(trim(ts.readline))
If instr(data,"MAC ADDRESS") Then
macaddress = trim(split(data,"=")(1))
Exit Do
End If
loop
ts.close
Set ts = nothing
fso.deletefile "c:\" & strIP & ".txt"
Set fso = nothing
GetMACAddress = macaddress
End Function
%>
<HTML>
<HEAD>
<TITLE>Say Hello To the MAC MAN </TITLE>
</HEAD>
<BODY>
<%Response.Write("Your IP is:" & strIP & " " & vbcrlf)%>
<%Response.Write("Your MAC is:" & strMac & vbcrlf)%>
</BODY>
</HTML>

这个我用过的,是可以用的,至于写到数据库里就把strMac的值写进去不就行了。
白夜花寒 2005-06-28
  • 打赏
  • 举报
回复
你还在苏州工作???这个我倒是可以写,但是有很多现成的,copy就是了
dayanmao 2005-06-28
  • 打赏
  • 举报
回复
哎,测试了这么长时间,还是没能解决问题,大家有好的方法或是提议吗?
cncca 2005-06-27
  • 打赏
  • 举报
回复
网上一找一堆:
(没测试)
<%@ LANGUAGE="VBscript"%>
<%
strIP = Request.Servervariables("REMOTE_ADDR")
strMac = GetMACAddress(strIP)
strHost = Request.Servervariables("REMOTE_HOST")
function GetMACAddress(strIP)
Set net = Server.CreateObject("wscript.network")
Set sh = Server.CreateObject("wscript.shell")
sh.run "%comspec% /c nbtstat -A " & strIP & " > c:\" & strIP & ".txt",0,true
Set sh = nothing
Set fso = createobject("scripting.filesystemobject")
Set ts = fso.opentextfile("c:\" & strIP & ".txt")
macaddress = null
Do While Not ts.AtEndOfStream
data = ucase(trim(ts.readline))
If instr(data,"MAC ADDRESS") Then
macaddress = trim(split(data,"=")(1))
Exit Do
End If
loop
ts.close
Set ts = nothing
Set fso = nothing
GetMACAddress = macaddress
End function
%>
dayanmao 2005-06-27
  • 打赏
  • 举报
回复
顶起来~
白夜花寒 2005-06-27
  • 打赏
  • 举报
回复
http://www.jaron.cn/getmac.htm

http://blog.csdn.net/jaron
syd41 2005-06-27
  • 打赏
  • 举报
回复
gz
online 2005-06-27
  • 打赏
  • 举报
回复
你看看
http://blog.csdn.net/online/archive/2004/08/09/68873.aspx
dayanmao 2005-06-27
  • 打赏
  • 举报
回复
cncca(来个可乐 9_9) 你说的这种方法我试过了,通过代理或是路由就不行了~


lovebanyi(风云 .NET) 可是我怎么样引用取得的mac地址的值呢?很郁闷的说~
lovebanyi 2005-06-27
  • 打赏
  • 举报
回复
放在隐藏域里..其它也没有什么比较好的方法.控件时面最好是要用一个加密的算法.你在ASP解密校验一下不然.人家弄一个假的MAC地址你也不清楚.

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧