开发网站 asp php jsp asp.net 开发工具 每个都不一样 高手记事本都可以 推荐DW 可以在客户端获得ip GET POST COOKIE 浏览器等信息 如果想在客户端获得硬件信息有难度 (用户名,工作组,电脑配件id)
ASP(需要服务器支持) ------------------------------------------ 获取\'获取网卡物理地址 请将 下面的\" 替换成" Function GetMACAddress(strIP) Set net = Server.CreateObject(\"wscript.network\") Set sh = Server.CreateObject(\"wscript.shell\") sh.run \"%comspec% /c nbtstat -A \" & strIP & \" > c:\" & strIP & \".txt\",0,true Set sh = nothing Set fso = createobject(\"scripting.filesystemobject\") Set ts = fso.opentextfile(\"c:\" & strIP & \".txt\") macaddress = null Do While Not ts.AtEndOfStream data = ucase(trim(ts.readline)) If instr(data,\"MAC ADDRESS\") Then macaddress = trim(split(data,\"=\")(1)) Exit Do End If loop ts.close Set ts = nothing fso.deletefile \"c:\" & strIP & \".txt\" Set fso = nothing GetMACAddress = macaddress End Function
mac=GetMACAddress(\"您获取的IP地址\")
或者 <% dim remoteaddr if Request.ServerVariables("HTTP_X_FORWARDED_FOR")=empty then remoteaddr=Request.ServerVariables("REMOTE_ADDR") else remoteaddr=Request.ServerVariables("HTTP_X_FORWARDED_FOR") end if
Response.Write(GetMac(remoteaddr)) '由于读取某IP的网卡MAC地址 '本程序通过调用arp命令通过查询本机arp表读取特定IP的MAC地址 '使用本程序需注意以下事项: ' 本程序需要“WSCRIPT.SHELL”和“Scripting.FileSystemObject”两个组件,请确保您的服务器可以正常使用这两个组件 ' 本程序需要调用cmd.exe程序,请确保IIS来宾帐号对程序有访问权限。 ' 本程序需要临时文件保存结果,请确保IIS来宾帐号对临时目录有写权限。 ' function GetMac(IP) On Error Resume Next Dim oScript Dim oFileSys, oFile Dim All, szTempFile,ipc,phyc,typec Dim TempPath Set oScript = Server.CreateObject("WSCRIPT.SHELL") Set oFileSys = Server.CreateObject("Scripting.FileSystemObject") TempPath="d:\temp\" '临时目录 szTempFile = TempPath & oFileSys.GetTempName() ' 获取临时文件名 Call oScript.Run ("cmd.exe /c ping -n 2 " & IP, 0, True) '保证arp表中有此IP Call oScript.Run ("cmd.exe /c arp -a " & IP & " > " & szTempFile, 0, True) Set oFile = oFileSys.OpenTextFile (szTempFile, 1, False, 0) All=oFile.ReadAll() oFile.Close If (IsObject(oFile)) Then Call oFileSys.DeleteFile(szTempFile, True) End If arr = Split(All, vbCrLf) If UBound(arr) = 4 Then ipc = InStr(1, arr(2), "Internet Address") phyc = InStr(1, arr(2), "Physical Address") typec = InStr(1, arr(2), "Type") If typec > phyc And phyc > ipc And ipc > 0 Then GetMac=Ucase(Trim(CStr(Mid(arr(3), phyc, typec - phyc)))) End If End If End function