Get IPv4 addresses from Dns.GetHostEntry()

前端 未结 7 1556
长发绾君心
长发绾君心 2020-11-27 04:49

I\'ve got some code here that works great on IPv4 machines, but on our build server (an IPv6) it fails. In a nutshell:

IPHostEntry ipHostEntry = Dns.GetHost         


        
7条回答
  •  臣服心动
    2020-11-27 05:25

    Have you looked at all the addresses in the return, discard the ones of family InterNetworkV6 and retain only the IPv4 ones?

提交回复
热议问题