string ipList = Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
if (!string.IsNullOrEmpty(ipList))
{
return ipList.Split(',')[0];
}
return Request.ServerVariables["REMOTE_ADDR"];
i am using above code. but its returns localhost address like 127.0.0.1. how can i use this code
Loading
Veena SardaPosted Oct 6, 2013, 2:09 PM
Sunny SharmaPosted Oct 5, 2013, 6:19 AM
I'm not getting the point here. If you try to get the IP of your local machine, it will give you 127.0.0.1 and that is Correct. So, what do you expect it to return?