Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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 shit 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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement