How To Get A User's Client IP Address In ASP.NET


We may not be able to find the exact IP Address of the Client. This is because, each user will be behind a proxy server or Router. From the router, the user can get IP from a wide range each time the user connect. Following describes an exact/approximate method for getting the IP Address of the client.



How To Get A User's Client IP Address In ASP.NET, Client IP Address In ASP.NET, User's IP Address In ASP.NET, Get IP Address In ASP.NET, Proxy Server, Router, IP Address, HTTP_X_FORWARDED_FOR, REMOTE_ADDR, Asp.Net, MVC, PHP, HTML

Write down the above code for getting the exact IP address of the client. Here client IP Address is stored in server variable named HTTP_X_FORWARDED_FOR. If that is empty, we can get IP from server variable named REMOTE_ADDR. By this way, we can get the exact/approximate IP address of the client.