获取服务器网卡信息,服务器_使用ASP获得服务器网卡的MAC地址信息,'----------------------提取所有网 - phpStudy...

使用ASP获得服务器网卡的MAC地址信息

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

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相关阅读:

php minixml详解

SQL教程(1):认识SQL

vbScript on error resume next容错使用心得

将多选框选中时打勾的颜色

Vista系统的Defrag整理磁盘碎片

win2003服务器下配置 MySQL 群集(Cluster)的方法

asp.NET 脏字过滤算法 修改版

采用AJAX提高网站程序的带宽性能详解

Vista系统中32位应用程序在64位的表现

High Performance JavaScript(高性能JavaScript)读书笔记分析

以图换字的几个方法及思路

浅析Oracle用户权限表的管理方法

一款简约的CSS翻页效果

Asp限制IP访问 阻止某一个IP段禁止访问本站的代码

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值