How to get IP Address using VB.Net
Author: Faraz
Download Source Code : 273_SampleProgram.zip
In this sample program I will try to explain you how you can get the IP addresses of your live sites or your local sites. Here I have created a sample program using VS2005.
Some time developing a web application you need to know their IP addresses for hosting etc. Visual Studio.Net and VS 2005 provides a feature for developers to know their websites IP by importing System.Net namespace in your console application. You all have to do is, create a new Console application and add the following code in your project:
Notice you can used above code for getting IP information of the live sites to know about the IP address of the local sites in your console application comments the above code and add the following code:
Notice code for live site and local site is same the only difference is you passed the live site URL in case of knowing the IP of live site and for local site you will pass localHost name in GetHostByName()method.