手机
当前位置:查字典教程网 >编程开发 >ASP教程 >使用ASP获得服务器网卡的MAC地址信息
使用ASP获得服务器网卡的MAC地址信息
摘要:'----------------------提取所有网卡的信息--------------------'PublicFunctionGet...

'----------------------提取所有网卡的信息--------------------'

PublicFunctionGetMacInfo()

OnErrorResumeNext

Dimfso,FileStr,AspSleepThread,CmdStr,SysDir,wshshell,CmdRe,MacFileContentFile,MacFileContent

ConstMacFile="TmpYesoulSoft001.LLP"

Setfso=Server.CreateObject("Scripting.FileSystemObject")

SysDir=Split(GlobalMod.GetSysDir,",")(1)

IfInStr(LCase(SysDir),"system32")=0Then

GetMacInfo="本系统只能运行在Nt、Windows2000、Windows.Net、WindowsXp、Windows2003等32位系统下,不支持32位以下的系统!"

ExitFunction

Else

CmdStr=SysDir+"Cmd.exe/C"+SysDir+"Ipconfig.exe/All>"+Server.MapPath(MacFile)

EndIf

CmdRe=Shell(CmdStr,vbHide)

IfCmdRe<>0Then

SetMacFileContentFile=fso.OpenTextFile(Server.MapPath(MacFile),1,False,TristateUseDefault)

'GetMacInfo=MacFileContentFile.ReadAll()

'Response.Flush

FileStr=MacFileContentFile.ReadAll()

MacFileContentFile.Close

SetMacFileContentFile=Nothing

SetAspSleepThread=Server.CreateObject("YesoulSoft.SleepThread")

'定义线程挂起的时间,这里为毫秒

AspSleepThread.SleepTime=500

AspSleepThread.BeginSleepThread

GetMacInfo=ExecuteOne(FileStr,"PhysicalAddress.........:(.*)")

SetAspSleepThread=Nothing

Else

GetMacInfo="系统当前无法获取您的网络信息,请检查权限继承关系后再运行本系统!"

ExitFunction

EndIf

DelFileMacFile

Setfso=Nothing

EndFunction

'------------------在字符串匹配一次结果-------------------'

PublicFunctionExecuteOne(inpStr,PatStr)

DimoRe,oMatch,oMatches

SetoRe=NewRegExp

oRe.Pattern=PatStr

inpStr=LCase(inpStr)

oRe.IgnoreCase=True

SetoMatches=oRe.Execute(inpStr)

SetoMatch=oMatches(0)

ExecuteOne=oMatch.SubMatches(0)

EndFunction

【使用ASP获得服务器网卡的MAC地址信息】相关文章:

ASP调用带参数存储过程的几种方式

使用ASP在IIS创建WEB站点的函数

在ASP中用组件检测当前网卡地址的代码

javascript asp教程服务器对象

用ASP实现hashMap功能的类

用ASP+DLL实现WEB方式修改服务器时间

ASP实现网址的桌面快捷方式下载

使用ASP启动/停止指定WEB站点

ASP上传图片功能的又一实现(OLE对象)

用asp自动解析网页中的图片地址

精品推荐
分类导航