Get remote name?

Discussion in 'ASP General' started by Lasse Edsvik, Jun 29, 2004.

  1. Lasse Edsvik

    Lasse Edsvik Guest

    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
     
    Lasse Edsvik, Jun 29, 2004
    #1
    1. Advertising

  2. Lasse Edsvik

    Ray at Guest

    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



    "Lasse Edsvik" <> wrote in message
    news:...
    > 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
    >
    >
     
    Ray at, Jun 29, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?iso-8859-1?B?bW9vcJk=?=
    Replies:
    7
    Views:
    897
    Roedy Green
    Jan 2, 2006
  2. ding feng
    Replies:
    2
    Views:
    2,913
    ding feng
    Jun 25, 2003
  3. alex
    Replies:
    3
    Views:
    466
  4. Bobby Chamness
    Replies:
    2
    Views:
    2,445
    Joe Smith
    Apr 22, 2007
  5. Jack-2
    Replies:
    3
    Views:
    334
    Jack-2
    Dec 24, 2003
Loading...

Share This Page