plz help me i already use this
Session["IPAddress2"] = HttpContext.Request.UserHostAddress; Session["IPAddress1"] = this.Request.UserHostAddress; Session["IPAddress"] = this.Request.ServerVariables["REMOTE_ADDR"];
and those 3 give me ::1
Hi fr3eddy,
While running this application on your machine locally i.e. in Visual Studio, the IP Address from the Request.ServerVariables REMOTE_ADDR will show as 127.0.0.1 or ::1. This happens because in such case the Client and Server both are the same machine. Thus no need to worry when you deploy it on a Server, you will see the results.
For more details refer the below article.
ASP.Net: Request.ServerVariables REMOTE_ADDR returns ::1
© COPYRIGHT 2025 ASPSnippets.com ALL RIGHTS RESERVED.