IP address

Discussion in 'ASP General' started by David, Nov 28, 2003.

  1. David

    David Guest

    Hi
    I'm trying to get remote ip address and local ip address
    of the user (i.e. machine name) but i couldnt find out it.
    however i can see the public remote ip address.here is
    the little code that i have written..

    <%
    For Each Item in Request.ServerVariables %>
    <tr>
    <td><%= Item %></td>
    <td><%=Request.ServerVariables(Item)%></td>
    </tr>
    <%
    Next
    %>

    Any help would be appreciated...
    Thanx in advance...
    David
    David, Nov 28, 2003
    #1
    1. Advertising

  2. David

    Ken Schaefer Guest

    You can't get the "machine name" using just the Request.ServerVariables()
    collection. The browser never sends the machine name to your webserver.

    Cheers
    Ken


    "David" <> wrote in message
    news:091b01c3b54f$741394b0$...
    : Hi
    : I'm trying to get remote ip address and local ip address
    : of the user (i.e. machine name) but i couldnt find out it.
    : however i can see the public remote ip address.here is
    : the little code that i have written..
    :
    : <%
    : For Each Item in Request.ServerVariables %>
    : <tr>
    : <td><%= Item %></td>
    : <td><%=Request.ServerVariables(Item)%></td>
    : </tr>
    : <%
    : Next
    : %>
    :
    : Any help would be appreciated...
    : Thanx in advance...
    : David
    Ken Schaefer, Nov 28, 2003
    #2
    1. Advertising

  3. Hi, you can use

    ip = Request.ServerVariables("REMOTE_ADDR")

    you can get the server name as:-

    servername = Request.ServerVariables("SERVER_NAME")

    Hope this helps

    Regards
    Bhaskardeep Khaund

    "Ken Schaefer" <> wrote in message news:#...
    You can't get the "machine name" using just the Request.ServerVariables()
    collection. The browser never sends the machine name to your webserver.

    Cheers
    Ken


    "David" <> wrote in message
    news:091b01c3b54f$741394b0$...
    : Hi
    : I'm trying to get remote ip address and local ip address
    : of the user (i.e. machine name) but i couldnt find out it.
    : however i can see the public remote ip address.here is
    : the little code that i have written..
    :
    : <%
    : For Each Item in Request.ServerVariables %>
    : <tr>
    : <td><%= Item %></td>
    : <td><%=Request.ServerVariables(Item)%></td>
    : </tr>
    : <%
    : Next
    : %>
    :
    : Any help would be appreciated...
    : Thanx in advance...
    : David
    Bhaskardeep Khaund, Nov 30, 2003
    #3
    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. avnrao
    Replies:
    1
    Views:
    7,223
    avnrao
    May 4, 2004
  2. Patrice
    Replies:
    0
    Views:
    883
    Patrice
    May 4, 2004
  3. Raterus
    Replies:
    0
    Views:
    435
    Raterus
    Jun 2, 2004
  4. Alex Stevens
    Replies:
    0
    Views:
    778
    Alex Stevens
    Aug 10, 2004
  5. =?Utf-8?B?QW5nZWw=?=

    Pass a Web Address and return a File System Address

    =?Utf-8?B?QW5nZWw=?=, Sep 20, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    536
    =?Utf-8?B?U3RldmUgQy4gT3Jy?=
    Sep 21, 2005
Loading...

Share This Page