no problems, thanks for the tweak.
Best regards,
Jason M. Murray [MSFT]
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm.
--------------------
| From: "Ray at <%=sLocation%>" <myfirstname at lane34 dot com>
| References: <
[email protected]>
<
[email protected]>
| Subject: Re: Mac Address
| Date: Tue, 23 Sep 2003 11:54:33 -0400
| Lines: 66
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <
[email protected]>
| Newsgroups: microsoft.public.inetserver.asp.general
| NNTP-Posting-Host: 209.3.214.171
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.inetserver.asp.general:253455
| X-Tomcat-NG: microsoft.public.inetserver.asp.general
|
| If you permit me to modify this a bit...
|
| function GetMACAddress(strIP)
| GetMacAddress = ""
| Set net = Server.CreateObject("wscript.network")
| Set sh = Server.CreateObject("wscript.shell")
| sh.run "%comspec% /c nbtstat -A " & strIP & "|find ""MAC
Address"">c:\"
| & strIP & ".txt",0,true
| Set sh = nothing
| Set fso = createobject("scripting.filesystemobject")
| fileContents = Trim(fso.opentextfile("c:\" & strIP &
".txt").ReadLine)
| fso.deletefile "c:\" & strIP & ".txt"
| Set fso = nothing
| GetMacAddress = Replace(fileContents, "MAC Address = ", "")
| End function
|
|
|
|
|
| Ray at work
|
| | > I don't think this will help your security needs BUT here is a function
I
| > have used a few times to pull mac address
| > <%
| > 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
| >
| > strMac = GetMACAddress(strIP)
| > %>
| >
| > <input type="text" name="MacADDY" value=<%Response.Write(strMac &
| > vbcrlf)%>/>
| >
| > Best regards,
| > Jason M. Murray [MSFT]
| > This posting is provided "AS IS" with no warranties, and confers no
| rights.
| > Use of included script samples are subject to the terms specified at
| >
http://www.microsoft.com/info/cpyright.htm.
| >
| >
|
|
|