Please let me know how to get the client IP address,
I have tried all of the below things , but I am getting the same output: 127.0.0.1
string strClientIP;
strClientIP = Request.UserHostAddress.ToString();
string strHostName = System.Net.Dns.GetHostName();
string clientIPAddress = System.Net.Dns.GetHostAddresses(strHostName).GetValue(0).ToString();
string ipaddress = string.Empty ;
ipaddress = Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
if (ipaddress == "" || ipaddress == null)
ipaddress = Request.ServerVariables["REMOTE_ADDR"];
How can I get the correct IP?