Click here to Skip to main content
13,004,446 members (75,330 online)
Rate this:
Please Sign up or sign in to vote.
See more:
Dear Sir/Ma'am

i create a website .
i want to fetch the ipaddress of the clients.
i run it at server and at two client but ip shown at a label.
but on all the systems only server ip is shown.
i want to see the ip of system at which website is running .Please help me
Posted 17-Mar-13 22:10pm
Updated 17-Mar-13 22:17pm
OriginalGriff 18-Mar-13 4:15am
DON'T SHOUT. Using all capitals is considered shouting on the internet, and rude (using all lower case is considered childish). Use proper capitalisation if you want to be taken seriously.
AnkurGupta OM 18-Mar-13 4:16am
sory sir but i am not shouting sir
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Easy: Request.UserHostAddress returns it: MSDN[^]
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

you don;t post your code !!! can you post the are you using and below code can capture the Ip Address like this:

       HttpRequest currentRequest = HttpContext.Current.Request;
             string ipAddress = currentRequest.ServerVariables["HTTP_X_FORWARDED_FOR"];
            if (ipAddress == null || ipAddress.ToLower() == "unknown")
                 ipAddress = currentRequest.ServerVariables["REMOTE_ADDR"];
            return ipAddress;

or like this

String ipAddress =

take a look of this link[^]
Rate this: bad
Please Sign up or sign in to vote.

Solution 3

string ipAddress = Request.ServerVariables["REMOTE_HOST"].ToString();

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170627.1 | Last Updated 18 Mar 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100