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
  • 32,421
  • 21
  • 173
  • 232
Sora
  • 2,697
  • 15
  • 62
  • 127

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
  • 27,966
  • 4
  • 78
  • 91
2

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

See this answer for details.

Community
  • 1
  • 1
SilverlightFox
  • 28,804
  • 10
  • 63
  • 132