- '----------------------提取所有網卡的信息--------------------'
- 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
使用ASP獲得服務器網卡的MAC地址信息
2019-10-26 12:07asp代碼網 ASP教程
使用ASP獲得服務器網卡的MAC地址信息
延伸 · 閱讀
- 2022-02-13易語言隨機生成MAC地址的代碼
- 2021-12-21winform C#獲得Mac地址,IP地址,子網掩碼,默認網關的
- 2021-12-10C#獲取路由器外網IP,MAC地址的實現代碼
- 2021-10-20關于ASP網頁無法打開的解決方案
- 2021-10-14讓apache也支持asp環境的方法
- 2021-10-10linux修改mac地址方法分享
精彩推薦
- ASP教程
ASP.NET 數據源
數據源 一個 data sourse 控件與數據綁定的控件相互作用,并隱藏了復雜的數據的聯編過程。這些是提供數據給 data bound 控件的工具,并且支持如插入,刪除...
- ASP教程
asp Access數據備份,還原,壓縮類代碼
asp Access數據備份,還原,壓縮類實現代碼,大家可以參考下。...
- ASP教程
asp 采集實戰代碼
最近實在是太流行采集了,本人是不喜歡采集的,但對采集的原理我卻很有興趣進行研究,拿到了網上采集常用函數,對其進行了一番研究,并實戰,結果...
- ASP教程
asp之基于adodb.stream的文件操作類
asp之基于adodb.stream的文件操作類...
- ASP教程
ASP常用函數:getpy()
ASP常用函數:getpy()...
- ASP教程
asp 標記字符串中指定字符變色不區分大小寫
今天遇到這種問題,單純的使用replace函數不行,他會改變原有的字符串的大小寫,在網上找到相關的代碼,自己備份下...
- ASP教程
asp+javascript實現404頁的處理轉換
asp+javascript實現404頁的處理轉換...
- ASP教程
JScript中遍歷Request表單參數集合的方法
這篇文章主要介紹了JScript中遍歷Request表單參數集合的方法,本文以遍歷Request.QueryString集合為例給出了實現代碼,需要的朋友可以參考下...