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.
LVL 5
Tom KnowltonWeb developerAsked:
Who is Participating?
 
Craig WagnerSoftware ArchitectCommented:
HttpContext.Current.Request
0
 
Tom KnowltonWeb developerAuthor Commented:
My eventual solution:

...
...

string path = HttpRuntime.AppDomainAppPath;

string ip = HttpContext.Current.Request.UserHostAddress;

...
...
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.