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

后端 未结 6 2144
慢半拍i
慢半拍i 2020-12-15 02:23

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

[WebMethod]
public void Foo()
{
    // HttpRequest... ? - Not giving me any options through intellisens         


        
6条回答
  •  情话喂你
    2020-12-15 03:09

    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.

提交回复
热议问题