CODEDIGEST InstallShield
Home Articles CodeDigest Tutorials InstallShield FAQs
Skip Navigation LinksHome » CodeDigest » Get Website IP Address in ASP.Net   You are not logged in.
Search
 

Sponsors
InstallShield
 

Sponsored Links
 

Technologies
 

CodeDigest Navigation
 

Technology News
No News Feeds available at this time.
 

Community News
No News Feeds available at this time.
 
Get Website IP Address in ASP.Net
Get Website IP Address in ASP.Net
Submitted By Satheesh Babu
On 6/2/2009 9:16:53 AM
Tags: ASP.Net,CodeDigest  

Get Website IP Address in ASP.Net

Sometimes, we may need to get the IP address of a website in asp.net.

The following little code snippet will help us to do that.

try
        {
            System.Net.IPAddress[] ip = System.Net.Dns.GetHostAddresses(txtSite.Text);
            Response.Write(ip[0]);
        }
        catch (System.Net.Sockets.SocketException)
        {
            Response.Write("No Such Website!");
        }

Do you have a working code that can be used by anyone? Submit it here. It may help someone in the community!!