07-03-2012, 12:53 AM
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.
- Do not apply via User CP even if you are accepted.
- Activity in Wemasters's support is must.
- See the Recruitment thread.