470,613 Members | 2,505 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,613 developers. It's quick & easy.

IP address

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
Jul 19 '05 #1
2 4565
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" <an*******@discussions.microsoft.com> wrote in message
news:09****************************@phx.gbl...
: 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
Jul 19 '05 #2
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" <ke*******@THISadOpenStatic.com> wrote in message news:#n**************@TK2MSFTNGP12.phx.gbl...
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" <an*******@discussions.microsoft.com> wrote in message
news:09****************************@phx.gbl...
: 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
Jul 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

21 posts views Thread by Alexander N. Spitzer | last post: by
8 posts views Thread by YAN | last post: by
4 posts views Thread by andreas.w.h.k. :-\) | last post: by
6 posts views Thread by Nicolas Noakes | last post: by
36 posts views Thread by Julienne Walker | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.