C#网络通信学习笔记-通过域名解析IP地址

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;
namespace ConsoleApplication6
{
    class Program
    {
        static void Main(string[] args)
        {
            IPHostEntry hostinfo = Dns.GetHostEntry(@www.baidu.com);
            IPAddress[] aryIP = hostinfo.AddressList;
            foreach (IPAddress result in aryIP)
            {
                Console.WriteLine(result.ToString());
            }
        }
    }
}

 <div style="height:100px;100px;border:1px solid red">

</div>

原文地址:https://www.cnblogs.com/Isesame/p/3266225.html