Get remote name?

L

Lasse Edsvik

Hello

I was wondering if it's possible to get "the name" istead of ip from a user
that runs a asp page?

cust10354-344.someisp.com istead of 231.13.434.23

/Lasse
 
R

Ray at

If your server is able to resolve the name, here's a fairly clumsy method.

<%
Dim sIP
Dim oShell, oExec, sCommand, sOutput
sIP = Request.ServerVariables("REMOTE_ADDR")
sCommand = "%comspec% /c @echo off & for /f ""tokens=2"" %q in ('ping -n
1 -a " & sIP & "^|find /i ""pinging""') do echo %q"
Set oShell = Server.CreateObject("WScript.Shell")
Set oExec = oShell.Exec(sCommand)
sOutput = sOutput & oExec.StdOut.ReadAll
Set oExec = Nothing
Set oShell = NOthing
Response.WRite sOutput
%>

Ray at work
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top