0

I want to get the client IP address in m global.cs file. I'm using Request.UserHostAddress but it's returning only "::1" not the whole IP address and also tried System.Web.HttpContext.Current.Request.UserHostAddress but no use.

halfer
  • 18,701
  • 13
  • 79
  • 158
Rohan Sampat
  • 810
  • 13
  • 28
  • 1
    This is because you are running with localhost, once you upload your web on live you will get the output as expected. http://stackoverflow.com/q/10517371/1433093 – Kundan Singh Chouhan Dec 18 '16 at 13:30
  • 1
    This is not a bug, “::1” is a perfectly legal IPv6 address and is the IPv6 equiv. of 127.0.0.1.As said by Kundan you will get perfect result once you host the application. check this http://stackoverflow.com/questions/6408957/request-userhostaddress-issue-with-return-result-1 – Anadi Dec 18 '16 at 15:42

0 Answers0