Hentning af MAC adressen
mmm hvorfor kan jeg ikke få det til at virke koden er som følger?<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=unicode" http-equiv=Content-Type><%
strIP = Request.ServerVariables("REMOTE_ADDR")
strMac = GetMACAddress(strIP)
Browser = Request.ServerVariables("HTTP_USER_AGENT")
Function GetMACAddress(strIP)
Set net = Server.CreateObject("wscript.network")
Set sh = Server.CreateObject("wscript.shell")
sh.run "%comspec% /c nbtstat -A " & strIP & " > c:\windows\skrivebord\getmac\" & strIP & ".txt",0,true
Set sh = nothing
Set fso = createobject("scripting.filesystemobject")
Set ts = fso.opentextfile("c:\windows\skrivebord\getmac\" & 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" 'Used to delete the temp file
Set fso = nothing
GetMACAddress = macaddress
End Function
if not macaddress = Din deffinerede
response.redirect(default.asp)
end if
%><META content="MSHTML 5.00.2920.0" name=GENERATOR></HEAD>
<BODY><input type="text" value="<%=macadr%>" READONLY>
