Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[VB.NET]GeoIP Using XML[Source]
#9
Here's the code.

Code:
Imports System.Xml
Public Class frmMain
    '''  <remarks>Feel free to use this codes but please give credit where it's due. I've spent a lot of time on this..lol
    ''' and I'm sharing it with the world for free. What I'm really trying to say is Don't steal my crap and claim it's yours.
    ''' coded by Ch4ng3m3</remarks>
    Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
        geoip()
    End Sub
    Private Sub geoip()
            Dim xmldoc As New XmlDocument
            Dim xmlnode As XmlNodeList
            Dim i As Integer
            xmldoc.Load("http://freegeoip.net/xml/" & TextBox1.Text)
            xmlnode = xmldoc.GetElementsByTagName("Response")
            For i = 0 To xmlnode.Count - 1
                xmlnode(i).ChildNodes.Item(0).InnerText.Trim()
                Label1.Text = "IP Address : " & xmlnode(i).ChildNodes.Item(0).InnerText.Trim()
                Label2.Text = "Country Code : " & xmlnode(i).ChildNodes.Item(1).InnerText.Trim()
                Label3.Text = "Country Name : " & xmlnode(i).ChildNodes.Item(2).InnerText.Trim()
                Label4.Text = "Region Code : " & xmlnode(i).ChildNodes.Item(3).InnerText.Trim()
                Label5.Text = "Region Name : " & xmlnode(i).ChildNodes.Item(4).InnerText.Trim()
                Label6.Text = "City : " & xmlnode(i).ChildNodes.Item(5).InnerText.Trim()
                Label7.Text = "Zip Code : " & xmlnode(i).ChildNodes.Item(6).InnerText.Trim()
                Label8.Text = "Latitude : " & xmlnode(i).ChildNodes.Item(7).InnerText.Trim()
                Label9.Text = "Longitude : " & xmlnode(i).ChildNodes.Item(8).InnerText.Trim()
                Label10.Text = "Metro Code : " & xmlnode(i).ChildNodes.Item(9).InnerText.Trim()
            Next
    End Sub
End Class
If you are willing to join SF Webmasters.
Reply


Messages In This Thread
[VB.NET]GeoIP Using XML[Source] - by Ch4ng3m3 - 06-27-2012, 03:29 AM
RE: [VB.NET]GeoIP Using XML[Source] - by Ch4ng3m3 - 07-02-2012, 07:00 AM
RE: [VB.NET]GeoIP Using XML[Source] - by Ch4ng3m3 - 07-02-2012, 07:19 PM
RE: [VB.NET]GeoIP Using XML[Source] - by Kewlz - 07-03-2012, 12:53 AM
RE: [VB.NET]GeoIP Using XML[Source] - by Ch4ng3m3 - 07-14-2012, 07:44 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Free Advanced Port Scanner SOURCE [ VB.NET ] Filefinder 6 5,747 01-22-2013, 04:27 AM
Last Post: TalishHF
  [VB.NET]Console app Menu example (amortization calculator)[Source] KoBE 8 8,168 12-28-2012, 06:55 AM
Last Post: mouse719
  [VB.NET] Get Region Info [Source] ƃu∀ ıʞƃu∀ 0 1,252 11-28-2012, 04:38 AM
Last Post: ƃu∀ ıʞƃu∀
  How To Make And Use A Builder And Stub. [VB.NET] [Source] Vorfin 35 23,247 11-25-2012, 10:34 PM
Last Post: ƃu∀ ıʞƃu∀
  [Source] Tricks Using PictureBox Control [VB.NET] Fragma 8 6,496 11-25-2012, 10:32 PM
Last Post: ƃu∀ ıʞƃu∀

Forum Jump:


Users browsing this thread: 10 Guest(s)