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
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