Get IP address of client machine

前端 未结 4 1277
情书的邮戳
情书的邮戳 2020-12-09 11:09

I am trying to get the IP address of client machine using C#. I am using the below code to get the IP address :

string IPAddress = HttpContext.Current.Reque         


        
4条回答
  •  攒了一身酷
    2020-12-09 11:35

    try using this

    string ip=System.Net.Dns.GetHostEntry
                   (System.Net.Dns.GetHostName()).AddressList.GetValue(0).ToString();
    

提交回复
热议问题