Below C# code can be used to get IP Address from Host name or UR
string IPs = string.Empty;
try
{
//performs the DNS lookup
IPHostEntry he = Dns.GetHostByName(“yoururl.com”);
IPAddress[] ip_addrs = he.AddressList;
foreach (IPAddress ip in ip_addrs)
{
IPs += ip + ” “;
}
}
catch (System.Exception ex)
{
}
No comments:
Post a Comment