0

I have a login page where the user can login to my website when the user click on the submit button in the login page I want to read it's Ip address how ca i do this is c# I tried this

   Request.UserHostAddress;

but the result was ::1 is it because I am logging in from the local machine or the statement that I used above is wrong?

Cœur
  • 34,719
  • 24
  • 185
  • 251
Sora
  • 2,795
  • 17
  • 68
  • 137

2 Answers2

2

That's basically the IPv6 version of 127.0.0.1 so is technically correct. If you don't use or need IPv6 disable it in the network adapter settings.

Lloyd
  • 28,624
  • 4
  • 82
  • 95
2

::1 is the IPv6 address, your code is correct.

See this answer for details.

Community
  • 1
  • 1
SilverlightFox
  • 30,831
  • 11
  • 71
  • 140