如何使用.NET / C#将域名解析为IP地址?
时间:2020-03-05 18:38:21 来源:igfitidea点击:
如何使用.NET / C#将域名解析为IP地址?
解决方案
回答
using System.Net; foreach (IPAddress address in Dns.GetHostAddresses("www.google.com")) { Console.WriteLine(address.ToString()); }
回答
尝试使用System.Net.Dns类