How do I get the caller's IP address in a WebMethod? How do I get the caller's IP address in a WebMethod? asp.net asp.net

How do I get the caller's IP address in a WebMethod?


Just a caution. IP addresses can't be used to uniquely identify clients. NAT Firewalls and corporate proxies are everywhere, and hide many users behind a single IP.


Try:

Context.Request.UserHostAddress