Hi All,
I have to fetch the ip address client machine.
for this i use the below code:
protected void Application_BeginRequest(object sender, EventArgs e)
{
HttpRequest request = base.Request;
string address = request.UserHostAddress;
base.Response.Write(address);
}
My Ip Address is 202.164.45.14
But when i run the above code on my local system, it returns ::1
And when i deploy it on my internal server it is giving 192.168.3.1
I also tried
HttpRequest.ServerVariables["REMOTE_ADDR"]
but it also gave same result.
Thanks,
Richa Sharma