greg938d72 greg938d72 - 1 year ago 70 Question

How do I get a user's ip address with .NET code?

How do I get a user's IP address with .NET code? I'm using Foo Basic Web Studio IDE that uses code.

Answer Source

Here is the way you can that IP address of users.

string clientIp = Request.ServerVariables("HTTP_X_FORWARDED_FOR");

       clientIp = Request.ServerVariables("REMOTE_ADDR")