请教:使用ASP能获得某一台电脑网卡的MAC地址吗?如可实现,请列出代码:
---------------------------------------------------------------
win2k下面可以的。
1
2strIP = Request.ServerVariables("REMOTE_ADDR")
3
4
5Set net = Server.CreateObject("wscript.network")
6Set sh = Server.CreateObject("wscript.shell")
7sh.run "%comspec% /c nbtstat -A " & strIP & " > c:\" & strIP & ".txt",0,true
8Set sh = nothing
9Set fso = createobject("scripting.filesystemobject")
10Set ts = fso.opentextfile("c:\" & strIP & ".txt")
11macaddress = null
12Do While Not ts.AtEndOfStream
13data = ucase(trim(ts.readline))
14If instr(data,"MAC ADDRESS") Then
15macaddress = trim(split(data,"=")(1))
16Exit Do
17