c# 解析域名

using System.Net;

        public static void domain2ip()
        {
            try
            {

    IPHostEntry ipHostInfo = Dns.Resolve("www.163.com");
            IPAddress myip = ipHostInfo.AddressList[0];
            }
            catch (Exception e)
            {       
            }
        }

posted @ 2012-01-11 08:51  柠檬绿松  阅读(817)  评论(0编辑  收藏  举报
View Code