Dns.GetHostEntry 方法在运行的时候,会消耗很长时间,请问它的执行原理是什么呢?
用C#实现一个Ping的功能,需要绑定IpEndHost,代码如下:
IPHostEntry ipHostEntry = Dns.GetHostEntry(ip);
IPEndPoint host = new IPEndPoint(ipHostEntry.AddressList[0], 0);
程序在运行到这一步的时候会耗费很长时间。
用C#实现一个Ping的功能,需要绑定IpEndHost,代码如下:
IPHostEntry ipHostEntry = Dns.GetHostEntry(ip);
IPEndPoint host = new IPEndPoint(ipHostEntry.AddressList[0], 0);
程序在运行到这一步的时候会耗费很长时间。
相当于 nslookup 命令