Click here to Skip to main content
Click here to Skip to main content
Go to top

Working with IP Addresses

, 12 Sep 2005
Rate this:
Please Sign up or sign in to vote.
Using a web service to find the location of an IP address...

Introduction

Imagine you have developed your own website, there are thousands of people visiting your website everyday. Do you want to know who your visitors are? In my article, I use a Web Service from www.webservicex.net to find the location of the IP addresses.

Using the code

First, you have to create a new application in Microsoft Visual Studio .NET 2003. To use the Web Service from www.webservicex.net, you have to let your application connect to the service and use its functions. In the Solution Explorer, right-click on Reference in your project and select Add Web Reference.

Then, the Add Web Reference window appears, type the address of your Web Service in the address bar. Our Web Service address is http://www.webservicex.net/geoipservice.asmx.

After the Web Service is found, type the name of the Web Reference in the Web Reference name text box. Finally, click on Add Reference button to add the Web Reference into your application.

Now, let's code for our application!!!

First of all, if you want to find the location of an IP Address, you simply type the IP address in a textbox, and click the button, the details of the IP address will be shown in the label below.

Private Sub btnOK_Click(ByVal sender As System.Object, _
        ByVal e As System.EventArgs) Handles btnOK.Click
     Dim ws As New GeoIPService.GeoIPService
     lblInformation.Text = "Country: " & _
       ws.GetGeoIP(txtIPAddress.Text).CountryName
End Sub

When you type the IP address in the textbox and click the button, the information about the IP address will be shown in the label as in the picture below:

Conclusion

I hope you will find some interesting things in this article. By using this Web Service, you know who visited your website by saving their IP address and using the web service to find their location.

If you feel interested in working with Web Services, let's take a look over at the website www.webservicex.net, there are more Web Services on this website that will be helpful for you!

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

Thang T.
Software Developer (Senior)
Vietnam Vietnam
I've been working as a freelance iOS developer since the invention of the original iPhone. After numbers of projects, I gain more and more experience, get familiar with popular 3rd-party libraries which can save time and cost in the development.
 
With the experiences gained by working on projects, I proudly offer consultancy service which supports my customers to (1) get the best way to develop their apps; (2) start up iOS apps business professionally & effectively.
 
My day starts with the practices Japanese traditional Martial Arts: Kendo (http://bit.ly/18gJm5) & Iaido (http://bit.ly/atyeSB). Therefore, I always work with Samurai Spirit in the entire day, no FEAR and willing to take CHALLENGES!
 
If you need to get your iOS games or apps done, I'm available at oDesk!
Follow on   Twitter

Comments and Discussions

 
General[Message Removed] Pinmemberhankjmatt13-Oct-08 22:12 
GeneralNice Article Pinmemberkkaratasli31-Jul-06 6:14 
Generalip address Pinmembersahar.taheri10-Feb-06 4:12 
QuestionHow can I find IP? Pinmembermahila20-Dec-05 2:13 
AnswerRe: How can I find IP? PinmemberThang Q. Tran20-Dec-05 13:36 
GeneralRe: How can I find IP? Pinmembermahila20-Dec-05 20:00 
GeneralRe: How can I find IP? PinmemberThang Q. Tran21-Dec-05 3:52 
GeneralRe: How can I find IP? Pinmembermahila23-Dec-05 18:14 
GeneralRe: How can I find IP? PinmemberWalton.Dave23-Feb-06 8:11 
GeneralRe: How can I find IP? PinmemberThang Q. Tran24-Feb-06 4:01 
GeneralWere can i find the database Pinmembervikas amin12-Sep-05 23:05 
GeneralRe: Were can i find the database Pinmembertom_dx13-Sep-05 2:05 
you could just make a program to get info and record info w/ ip address although this would be a massive amount of data, i estimate alot of terabytes
 
IM PROUD TO BE A GMAIL;
GeneralRe: Were can i find the database PinmemberThang Q. Tran13-Sep-05 3:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web02 | 2.8.140916.1 | Last Updated 12 Sep 2005
Article Copyright 2005 by Thang T.
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid