Click here to Skip to main content
15,892,059 members
Articles / Web Development / CSS

Working with IP Addresses

Rate me:
Please Sign up or sign in to vote.
3.86/5 (12 votes)
12 Sep 20052 min read 78.3K   851   27  
Using a web service to find the location of an IP address...
Public Class WebForm1
    Inherits System.Web.UI.Page



#Region " Web Form Designer Generated Code "

    'This call is required by the Web Form Designer.
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()

    End Sub
    Protected WithEvents lblInformation As System.Web.UI.WebControls.Label
    Protected WithEvents btnOK As System.Web.UI.WebControls.Button
    Protected WithEvents txtIPAddress As System.Web.UI.WebControls.TextBox
    Protected WithEvents Label1 As System.Web.UI.WebControls.Label

    'NOTE: The following placeholder declaration is required by the Web Form Designer.
    'Do not delete or move it.
    Private designerPlaceholderDeclaration As System.Object

    Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
        'CODEGEN: This method call is required by the Web Form Designer
        'Do not modify it using the code editor.
        InitializeComponent()
    End Sub

#End Region

    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'Put user code to initialize the page here
    End Sub

    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
End Class

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.


Written By
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!

Comments and Discussions