How can i get IP Address of my 3G modem?

You can get a list of your IP addresses via DNS using the following code:

var name = Dns.GetHostName();
var entry = Dns.GetHostEntry(name);
foreach (var address in entry.AddressList) {

If you want the IP address as a property of the hardware, you can use the System.Management.ManagementClass with the name Win32_NetworkAdapterConfiguration. See for details.

4 down vote

You can use the static method WebClient.DownloadString(url) to read your external IP address from any web service providing such data:

string ip = System.Net.WebClient.DownloadString(“”);

If you are going to use this in a production environment, better make sure that the URL you are pointing to, is guaranteed to stay around for the entire lifespan of your application. The best way is probably to host the web service yourself.

Also, you should add some error checking around this code, as it will fail if the internet connection or the web service is unavailable.

1 down vote

You can create a WebRequest to which houses only your IP address

Start here

About eagle081183

Passionate, Loyal
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s