标题:大家帮忙看一下
只看楼主
fqei
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2005-2-1
 问题点数:0 回复次数:0 
大家帮忙看一下
我想通过网卡物理地址控制上网,可是地址是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
%>
2005-02-01 14:47



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-11905-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 2.040790 second(s), 7 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved