Link to home
Start Free TrialLog in
Avatar of Tom Knowlton
Tom KnowltonFlag for United States of America

asked on

Alternative to HttpRequest.UserHostAddress

To get the IP of the requestor, is there an alternative to using HttpRequest.UserHostAddress?

Sometimes I don't have a Page object handy so I need an alternative to Page.Request.UserHostAddress.
ASKER CERTIFIED SOLUTION
Avatar of Craig Wagner
Craig Wagner
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Tom Knowlton

ASKER

My eventual solution:

...
...

string path = HttpRuntime.AppDomainAppPath;

string ip = HttpContext.Current.Request.UserHostAddress;

...
...