- '----------------------提取所有網(wǎng)卡的信息--------------------'
- 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 = "本系統(tǒng)只能運行在Nt、Windows 2000、Windows.Net、Windows Xp、Windows 2003等32位系統(tǒng)下,不支持32位以下的系統(tǒng)!"
- 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 = "系統(tǒng)當前無法獲取您的網(wǎng)絡(luò)信息,請檢查權(quán)限繼承關(guān)系后再運行本系統(tǒng)!"
- Exit Function
- End If
- DelFile MacFile
- Set fso = Nothing
- End Function
- '------------------在字符串匹配一次結(jié)果-------------------'
- 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獲得服務(wù)器網(wǎng)卡的MAC地址信息
2019-10-26 12:07asp代碼網(wǎng) ASP教程
使用ASP獲得服務(wù)器網(wǎng)卡的MAC地址信息
延伸 · 閱讀
- 2022-02-13易語言隨機生成MAC地址的代碼
- 2021-12-21winform C#獲得Mac地址,IP地址,子網(wǎng)掩碼,默認網(wǎng)關(guān)的
- 2021-12-10C#獲取路由器外網(wǎng)IP,MAC地址的實現(xiàn)代碼
- 2021-10-20關(guān)于ASP網(wǎng)頁無法打開的解決方案
- 2021-10-14讓apache也支持asp環(huán)境的方法
- 2021-10-10linux修改mac地址方法分享
- ASP教程
ASP.NET 數(shù)據(jù)源
數(shù)據(jù)源 一個 data sourse 控件與數(shù)據(jù)綁定的控件相互作用,并隱藏了復(fù)雜的數(shù)據(jù)的聯(lián)編過程。這些是提供數(shù)據(jù)給 data bound 控件的工具,并且支持如插入,刪除...
- ASP教程
asp Access數(shù)據(jù)備份,還原,壓縮類代碼
asp Access數(shù)據(jù)備份,還原,壓縮類實現(xiàn)代碼,大家可以參考下。...
- ASP教程
asp 采集實戰(zhàn)代碼
最近實在是太流行采集了,本人是不喜歡采集的,但對采集的原理我卻很有興趣進行研究,拿到了網(wǎng)上采集常用函數(shù),對其進行了一番研究,并實戰(zhàn),結(jié)果...
- ASP教程
asp之基于adodb.stream的文件操作類
asp之基于adodb.stream的文件操作類...
- ASP教程
ASP常用函數(shù):getpy()
ASP常用函數(shù):getpy()...
- ASP教程
asp 標記字符串中指定字符變色不區(qū)分大小寫
今天遇到這種問題,單純的使用replace函數(shù)不行,他會改變原有的字符串的大小寫,在網(wǎng)上找到相關(guān)的代碼,自己備份下...
- ASP教程
asp+javascript實現(xiàn)404頁的處理轉(zhuǎn)換
asp+javascript實現(xiàn)404頁的處理轉(zhuǎn)換...
- ASP教程
JScript中遍歷Request表單參數(shù)集合的方法
這篇文章主要介紹了JScript中遍歷Request表單參數(shù)集合的方法,本文以遍歷Request.QueryString集合為例給出了實現(xiàn)代碼,需要的朋友可以參考下...