1

How can i get Client IP address.My application is made in ASP.net c#.

Is there any function in jquery we can use to fetch client IP address and name when user login into my application.

Thanks

hims
  • 59
  • 1
  • 6
  • 1
    Question same as like [this](http://stackoverflow.com/questions/19953328/how-to-get-ip-address-using-javascript-or-jquery) – M.Y.Mnu Feb 17 '17 at 09:33

1 Answers1

3

I have this little C# property snippet which returns IP address of actual user connected to the server.

public static string ClientIP
    {
        get
        {
            return HttpContext.Current.Request.UserHostAddress;
        }
    }

If you want to use in your JQuery source code then you need to insert this into your generated cshtml.

Shoter
  • 651
  • 8
  • 17