您当前的位置: 首页 >  c#

柳鲲鹏

暂无认证

  • 0浏览

    0关注

    4642博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

C#中IPAddress与域名的使用

柳鲲鹏 发布时间:2018-07-11 16:02:18 ,浏览量:0

  一个字串,是"192.168.1.6",使用IPAddress.Parse()。

  如果是域名呢?

 

using System.Net;
IPHostEntry host = Dns.GetHostByName("blog.csdn.net");
IPAddress ip = host.AddressList[0];
textView.Text = ip.ToString();
IPHostEntry host = Dns.GetHostByName("blog.csdn.net");
IPAddress ip = host.AddressList[0];
textView.Text = ip.ToString();

 

关注
打赏
1665724893
查看更多评论
立即登录/注册

微信扫码登录

0.0499s