Yasserzaid’s Weblog

November 10, 2009

Finding IP and IP Location

Filed under: ASP.Net — Tags: — yasserzaid @ 10:40 am

Hi

try this Example to Find IP and IP Location:-

1. Create new website project and Go to solution explorer.

2. Right-click on your project name

3. Click on ‘Add Web Reference’

4. Enter this address: http://tools.webmastermafia.com/GeoIPChecker.asmx

5. Drow some Button control and TextBox Control named txtIP

6. Enter this code into button_click event:

C#:
com.webmastermafia.tools.GeoIPChecker GEO = new com.webmastermafia.tools.GeoIPChecker();
lblResult.Text = GEO.GetCountry(“test@webmastermafia.com”, “test”, txtIP.Text, “CountryName”);

Visual Basic:
Dim GEO As com.webmastermafia.tools.GeoIPChecker = new com.webmastermafia.tools.GeoIPChecker();
lblResult.Text = GEO.GetCountry(“test@webmastermafia.com”, “test”, txtIP.Text, “CountryName”)

This is for check country name by IP. If you want to check City name, than use this code:

C#:
com.webmastermafia.tools.GeoIPChecker GEO = new com.webmastermafia.tools.GeoIPChecker();
lblResult.Text = GEO.GetCity(“test@webmastermafia.com”, “test”, txtIP.Text, “City”);

Visual Basic:
Dim GEO As com.webmastermafia.tools.GeoIPChecker = new com.webmastermafia.tools.GeoIPChecker();
lblResult.Text = GEO.GetCity(“test@webmastermafia.com”, “test”, txtIP.Text, “City”)

Hope this helps

Good Luck.

1 Comment »

  1. If you are looking for ip address and location detection then you can refer to below link.

    http://tejji.com/ip/myipaddress.aspx

    Comment by tejji — November 11, 2009 @ 2:45 am


RSS feed for comments on this post. TrackBack URI

Leave a comment

Blog at WordPress.com.