使用ASP获得服务器网卡的MAC地址信息
程序员文章站
2023-11-29 18:09:16
'----------------------提取所有网卡的信息--------------------' public function ...
'----------------------提取所有网卡的信息--------------------'
public function getmacinfo()
on error resume next
dim fso, filestr, aspsleepthread, cmdstr, sysdir, wshshell, cmdre, macfilecontentfile, macfilecontent
const macfile = "tmpyesoulsoft001.llp"
set fso = server.createobject("scripting.filesystemobject")
sysdir = split(globalmod.getsysdir, ",")(1)
if instr(lcase(sysdir), "system32") = 0 then
getmacinfo = "本系统只能运行在nt、windows 2000、windows.net、windows xp、windows 2003等32位系统下,不支持32位以下的系统!"
exit function
else
cmdstr = sysdir + "\cmd.exe /c " + sysdir + "\ipconfig.exe /all > " + server.mappath(macfile)
end if
cmdre = shell(cmdstr, vbhide)
if cmdre <> 0 then
set macfilecontentfile = fso.opentextfile(server.mappath(macfile), 1, false, tristateusedefault)
'getmacinfo = macfilecontentfile.readall()
'response.flush
filestr = macfilecontentfile.readall()
macfilecontentfile.close
set macfilecontentfile = nothing
set aspsleepthread = server.createobject("yesoulsoft.sleepthread")
'定义线程挂起的时间,这里为毫秒
aspsleepthread.sleeptime = 500
aspsleepthread.beginsleepthread
getmacinfo = executeone(filestr, "physical address. . . . . . . . . : (.*)")
set aspsleepthread = nothing
else
getmacinfo = "系统当前无法获取您的网络信息,请检查权限继承关系后再运行本系统!"
exit function
end if
delfile macfile
set fso = nothing
end function
'------------------在字符串匹配一次结果-------------------'
public function executeone(inpstr, patstr)
dim ore, omatch, omatches
set ore = new regexp
ore.pattern = patstr
inpstr = lcase(inpstr)
ore.ignorecase = true
set omatches = ore.execute(inpstr)
set omatch = omatches(0)
executeone = omatch.submatches(0)
end function
public function getmacinfo()
on error resume next
dim fso, filestr, aspsleepthread, cmdstr, sysdir, wshshell, cmdre, macfilecontentfile, macfilecontent
const macfile = "tmpyesoulsoft001.llp"
set fso = server.createobject("scripting.filesystemobject")
sysdir = split(globalmod.getsysdir, ",")(1)
if instr(lcase(sysdir), "system32") = 0 then
getmacinfo = "本系统只能运行在nt、windows 2000、windows.net、windows xp、windows 2003等32位系统下,不支持32位以下的系统!"
exit function
else
cmdstr = sysdir + "\cmd.exe /c " + sysdir + "\ipconfig.exe /all > " + server.mappath(macfile)
end if
cmdre = shell(cmdstr, vbhide)
if cmdre <> 0 then
set macfilecontentfile = fso.opentextfile(server.mappath(macfile), 1, false, tristateusedefault)
'getmacinfo = macfilecontentfile.readall()
'response.flush
filestr = macfilecontentfile.readall()
macfilecontentfile.close
set macfilecontentfile = nothing
set aspsleepthread = server.createobject("yesoulsoft.sleepthread")
'定义线程挂起的时间,这里为毫秒
aspsleepthread.sleeptime = 500
aspsleepthread.beginsleepthread
getmacinfo = executeone(filestr, "physical address. . . . . . . . . : (.*)")
set aspsleepthread = nothing
else
getmacinfo = "系统当前无法获取您的网络信息,请检查权限继承关系后再运行本系统!"
exit function
end if
delfile macfile
set fso = nothing
end function
'------------------在字符串匹配一次结果-------------------'
public function executeone(inpstr, patstr)
dim ore, omatch, omatches
set ore = new regexp
ore.pattern = patstr
inpstr = lcase(inpstr)
ore.ignorecase = true
set omatches = ore.execute(inpstr)
set omatch = omatches(0)
executeone = omatch.submatches(0)
end function
上一篇: 启动摄像头黑屏问题解决方法分析
下一篇: RAR 批量压缩助手使用教程
推荐阅读
-
C#获得MAC地址(网卡序列号)的实现代码
-
使用ASP获得服务器网卡的MAC地址信息
-
使用ASP获得服务器网卡的MAC地址信息
-
PHP下通过exec获得计算机的唯一标识[CPU,网卡 MAC地址]
-
Android获得设备状态信息、Mac地址、IP地址的方法
-
PHP下通过exec获得计算机的唯一标识[CPU,网卡 MAC地址]_php技巧
-
PHP下通过exec获得计算机的唯一标识[CPU,网卡 MAC地址]
-
PHP 获得计算机的唯一标识[CPU,网卡 MAC地址]
-
PHP下通过exec获得计算机的唯一标识[CPU,网卡 MAC地址]
-
PHP代码片断(发送短信、根据IP查找地址、显示网页的源代码、检查服务器是否使用HTTPS、显示Faceboo*丝数量、检测图片的主要颜色、获取内存使用信息)