How do I get the caller\'s IP address in a WebMethod?
[WebMethod] public void Foo() { // HttpRequest... ? - Not giving me any options through intellisens
Try this:
string ipAddress = HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"];
Haven't tried it in a webMethod, but I use it in standard HttpRequests