<% @ Language = "VBScript"%> <% strip = request.servervariables ("remote_addr") strMac = getMacaddress (strip) strhost = request.servervariables ("remote_host")
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 & ". C: /" & strip "set fso = nothing getmacaddress = macaddress end function%>