473,396 Members | 1,864 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How to Get Client IP Address

Hi All,

I am trying to get the IP address of the Client machine and using the code:

Response.Write(Request.ServerVariables("REMOTE_ADD R"))

But I only get 127.0.0.1

It should be giving the IP address of the system or the gateway. How can I
get that. Please help.

Thanks
Prabhat
Sep 23 '05 #1
8 45172
On Fri, 23 Sep 2005 22:53:53 +0530, "Prabhat" <no********@hotmail.com> wrote:
Hi All,

I am trying to get the IP address of the Client machine and using the code:

Response.Write(Request.ServerVariables("REMOTE_AD DR"))

But I only get 127.0.0.1

It should be giving the IP address of the system or the gateway. How can I
get that. Please help.

Thanks
Prabhat

Well that should work ( it does when I created this page called WhereFrom.asp:

<%
Response.Write(Request.ServerVariables("REMOTE_ADD R"))
%>

I placed it in a devfiles directory on our web server ( IIS 5) and, from my Client PC (using IE), went to
http://mywebserver/devfiles/WhereFrom.asp

and got my Client PC's IP address..
So I am at a loss to se why, if you followed similar steps, it should fail..
Sep 23 '05 #2
"Prabhat" <no********@hotmail.com> wrote in message
news:OT**************@tk2msftngp13.phx.gbl...
Hi All,

I am trying to get the IP address of the Client machine and using the code:
Response.Write(Request.ServerVariables("REMOTE_ADD R"))

But I only get 127.0.0.1

It should be giving the IP address of the system or the gateway. How can I
get that. Please help.

Thanks
Prabhat

http://www.aspfaq.com/5003
Sep 23 '05 #3
"McKirahan" <Ne**@McKirahan.com> wrote in message
news:Xr********************@comcast.com...

http://www.aspfaq.com/5003


Nevermind -- sorry.

BTW, how are is the page invoked; hopefully not by
http://localhost/yourpage.asp
which would, of course, give 127.0.0.1
Sep 23 '05 #4
> BTW, how are is the page invoked; hopefully not by
http://localhost/yourpage.asp
which would, of course, give 127.0.0.1

I have invoked the page like: http://localhost/website/page.asp So you mean
to say this will give 127.0.0.1. So How do I test the website in local IIS.
Please suggest so that I can get the proper IP address.

Thanks
Prabhat
Sep 25 '05 #5
> Well that should work ( it does when I created this page called
WhereFrom.asp:

<%
Response.Write(Request.ServerVariables("REMOTE_ADD R"))
%>

I placed it in a devfiles directory on our web server ( IIS 5) and, from
my Client PC (using IE), went to
http://mywebserver/devfiles/WhereFrom.asp

and got my Client PC's IP address..
So I am at a loss to se why, if you followed similar steps, it should
fail..


I have invoked the page like: http://localhost/website/page.asp that gives
me 127.0.0.1. Please suggest.

Thanks
Prabhat
Sep 25 '05 #6
"Prabhat" <no*********@hotmail.com> wrote in message
news:#K**************@tk2msftngp13.phx.gbl...
BTW, how are is the page invoked; hopefully not by
http://localhost/yourpage.asp
which would, of course, give 127.0.0.1
I have invoked the page like: http://localhost/website/page.asp So you

mean to say this will give 127.0.0.1. So How do I test the website in local IIS. Please suggest so that I can get the proper IP address.

Thanks
Prabhat

That is the proper IP address for localhost.

If you want a different one then put your page on another Web server.

Or, if outsiders can visit your Web page then their IP address will show up.

Us "winipcfg" to identify your IP address and use that
(from another computer) to access your page.
Sep 25 '05 #7
That is the proper IP address for localhost.

If you want a different one then put your page on another Web server.

Or, if outsiders can visit your Web page then their IP address will show
up.

Us "winipcfg" to identify your IP address and use that
(from another computer) to access your page.

Hi,

Thanks for the suggestion. I have used http://MyComputerName/webpage.asp and
able to get the IP address correctly but using Localhost gives 127.0.0.1.

Thanks
Prabhat
Sep 26 '05 #8

"Prabhat" <no*********@hotmail.com> wrote in message
news:eM**************@tk2msftngp13.phx.gbl...
That is the proper IP address for localhost.

If you want a different one then put your page on another Web server.

Or, if outsiders can visit your Web page then their IP address will show
up.

Us "winipcfg" to identify your IP address and use that
(from another computer) to access your page.

Hi,

Thanks for the suggestion. I have used http://MyComputerName/webpage.asp
and able to get the IP address correctly but using Localhost gives
127.0.0.1.


localhost ***always*** returns 127.0.0.1 this is one of the standards that
the TCP/IP protocol implies.

If you start your command prompt (cmd.exe)
you try this for instance
ping localhost

you'll get the IP address as well.

Sep 26 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: JezB | last post by:
Any way I can get at a unique "Client ID" within server code ? I'm writing some auditing and I want to record which particular client machine initiated a request, for example. I imagine in an...
4
by: Andy | last post by:
Hi all, In a recent intranet project, I want to limit the access to my mobile asp.net appl only to a set of authorized MAC addresses by determining client's MAC address. Is there any way to...
4
by: rs | last post by:
how I the client tell the server that the socket is closed? or this there an even that informs the server that the clients socket is close? Oh, I am using vb.net 2003 Thanks
4
by: Goh | last post by:
Hi, I would like to know how can we implement a web page that intelligent enough to unique identify that pc have been visit before without any cookies and login user require. I have try...
13
by: Sandeep Singh | last post by:
I am making socket client application in C# how can i get ip address of client who has connected to server
14
by: Ankit Aneja | last post by:
The code of classes given below is for server to which clients connect i want to get ip address of client which has connected pls help how can i get //listen class public class listen {
13
by: James | last post by:
Hi, I'm new to ASP .NET, working on a school project, which i need to find out the client's MAC address. However in my search on the web, i have not find any method available, and some mention...
2
by: WhatHappend | last post by:
I have converted a .Net 1.0 application to .Net 2.0 and the web service invocations have delay of around 10seconds on each intial access. After the first access subsequent access are fast (After a...
3
by: RFD | last post by:
I've been slaving at this problem for over a week, and would appreciate some help from you kind folks. Basic Problem: I have made a server program and a client program. When I try to use the...
15
by: Mike | last post by:
Hi ASP Gurus, Please help me solving my problem. I am trying to get the clients IP address but I am not able to do it successfully. I have tried: Request.ServerVariables("http_user_agent")...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.