Thursday, 11 August 2011

How to Client IP Address in ASP.NET

Use the following code:
string ip = HttpContext.Current.Request.UserHostAddress.ToString();

while testing in localhost you will get only 127.0.0.1
but if you uploaded in server and test then surely u'll get correct ip only

Tag: How to Client IP Address in ASP.NET, how to get ip address in asp.net, how to know ip address, ip address in asp.net

No comments:

Post a Comment

Parsing JSON w/ @ symbol in it

To read the json response like bellow @ concatenated with attribute                             '{ "@id": 1001, "@name&q...