Alex Rivera | Logout

Get User's IP Address

Asked 2010-04-12T09:22:14.933
20

How can I get the current visitors IP address?

Edit
Report

1 Answer

20

HttpContext.Current.Request.UserHostAddress;

or

HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"];

or

HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"];

answered 2010-04-12T09:23:45.993

Your Answer