ASP.NET (35) SQL (25) JAVASCRIPT (24) HTML (14) STYLE SHEET (6) ASP (4) SCRIPT (1)

Search me out HERE!!

Find IPAddress from host name or URL


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