大家帮忙看一下
我想通过网卡物理地址控制上网,可是地址是16进制,用下面程序总是说GetMac("192.168.0.83")和"00-0A-EB-83-92-23" 不相等,大家看一下源程序:
<%
function GetMac(strIP)
if IsNull(strIP) or strIP="" then
strIP = Request.ServerVariables("REMOTE_ADDR")
end if
Dim strrnd,net,sh,fso,ts,macaddress
randomize
strrnd=rnd(10)
Set net = Server.CreateObject(")
Set sh = Server.CreateObject("wscript.shell")
sh.run "%comspec% /c nbtstat -A " & strIP & " > c:\" & strrnd & ".txt",0
,true
Set sh = nothing
Set fso = createobject("scripting.filesystemobject")
Set ts = fso.opentextfile("c:\" & strrnd & ".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:\" & strrnd & ".txt"
Set fso = nothing
GetMac = macaddress
End Function
if GetMac("192.168.0.83")<>"00-0A-EB-83-92-23" then
response.write"<center>Äú²»ÊÇϵͳ³ÐÈÏÓû§,ÎÞȨ²ì¿´±¾ÄÚÈÝ"
response.End()
end if
%>