国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > ASP > 正文

使用ASP獲得服務器網卡的MAC地址信息

2020-07-27 13:17:41
字體:
來源:轉載
供稿:網友
'----------------------提取所有網卡的信息--------------------' 

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
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 秭归县| 定州市| 建水县| 道孚县| 二连浩特市| 新源县| 东莞市| 淮南市| 涟源市| 凤城市| 浙江省| 定南县| 昭通市| 江津市| 阳朔县| 准格尔旗| 大厂| 延安市| 礼泉县| 崇左市| 华亭县| 海伦市| 扬州市| 个旧市| 青河县| 岳普湖县| 武邑县| 博兴县| 灵宝市| 榆中县| 西林县| 黄石市| 沙洋县| 朔州市| 万山特区| 潍坊市| 固阳县| 东乌珠穆沁旗| 海城市| 南昌县| 布拖县|