sing System.Net;
IPHostEntry hostInfo = Dns.GetHostByName( "www.where365.com ");
Response.Write(hostInfo.AddressList[0]);
本文演示了如何使用C#语言和System.Net命名空间中的Dns类来获取指定网站(本例为www.where365.com)的IP地址。通过调用GetHostByName方法并传入网站域名,可以得到该网站对应的IPHostEntry对象,进而访问其AddressList属性来获取IP地址。
sing System.Net;
IPHostEntry hostInfo = Dns.GetHostByName( "www.where365.com ");
Response.Write(hostInfo.AddressList[0]);
734
3617

被折叠的 条评论
为什么被折叠?