Getting Client IP address inside a driver

Topics: General, Localization
Nov 9, 2013 at 7:59 PM
Hi:
I'm working on a project and I need to get user zip code, I already have a library to do so based on the user IP address, but I need to get that IP inside a part driver as part of a widget that uses that feature.
Any help/advice will be very appreciated
Thanks in advance
Developer
Nov 9, 2013 at 11:27 PM
Edited Nov 9, 2013 at 11:30 PM
Use IHttpContextAccessor to get the current HttpContext. User IP is somewhere in there.
Aug 15 at 5:51 PM
Edited Aug 15 at 5:51 PM
This was a while ago but just to be a little more specific {HttpContext}.Current().Request.UserHostAddress for future visitors.