Getting Client IP address inside a driver

Topics: General, Localization
Nov 9, 2013 at 8:59 PM
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
Nov 10, 2013 at 12:27 AM
Edited Nov 10, 2013 at 12:30 AM
Use IHttpContextAccessor to get the current HttpContext. User IP is somewhere in there.
Aug 15, 2014 at 6:51 PM
Edited Aug 15, 2014 at 6:51 PM
This was a while ago but just to be a little more specific {HttpContext}.Current().Request.UserHostAddress for future visitors.