天天看點

C# .net通過域名擷取IP(轉)

        IPAddress[] IPs = Dns.GetHostAddresses("www.by84.com");

        foreach (IPAddress ip in IPs)

        {

           Response.Write(ip.ToString()+"<br>");

        }

别忘了引用System.Net命名空間.