GetHostByAddress(www.163.com)就失败,GetHostByAddress(127.0.0.1)就成功,为什么?
我想根据网址获得ip地址,用这样:
IPHostEntry ip=System.Net.Dns.GetHostByAddress("www.163.com");
就出现错误。
而这样就没有错误:
IPHostEntry ip=System.Net.Dns.GetHostByAddress("127.0.0.1");
可是我就是为了根据网址获得ip地址
GetHostByAddress这个函数到底怎么用啊!