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
  • 37,241
  • 25
  • 195
  • 267
Sora
  • 2,465
  • 18
  • 73
  • 146

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
  • 29,197
  • 4
  • 84
  • 98
2

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

See this answer for details.

Community
  • 1
  • 1
SilverlightFox
  • 32,436
  • 11
  • 76
  • 145