Private Sub BricksButton1_Click(ByVal sender As Object, ByVal e As EventArgs)
Dim expression As String = Me.wg.DownloadString(("http://freegeoip.net/xml/" & Me.BricksTextbox1.Text))
Dim str5 As String = Strings.Split(expression, "<IP>", -1, CompareMethod.Binary)(1)
str5 = Strings.Split(str5, "</IP>", -1, CompareMethod.Binary)(0)
If (str5 = Nothing) Then
str5 = "-------------"
End If
Me.BricksLabel1.Text = str5
Dim str2 As String = Strings.Split(expression, "<CountryName>", -1, CompareMethod.Binary)(1)
str2 = Strings.Split(str2, "</CountryName>", -1, CompareMethod.Binary)(0)
If (str2 = Nothing) Then
str2 = "-------------"
End If
Me.BricksLabel2.Text = str2
Dim str3 As String = Strings.Split(expression, "<CountryCode>", -1, CompareMethod.Binary)(1)
str3 = Strings.Split(str3, "</CountryCode>", -1, CompareMethod.Binary)(0)
If (str3 = Nothing) Then
str3 = "-------------"
End If
Me.BricksLabel3.Text = str3
Dim client As New WebClient
Dim bitmap As Bitmap = DirectCast(Image.FromStream(New MemoryStream(client.DownloadData(("http://serverupload.altervista.org/flag/flat/" & str3 & ".png")))), Bitmap)
Me.PictureBox1.Image = bitmap
Dim str9 As String = Strings.Split(expression, "<RegionName>", -1, CompareMethod.Binary)(1)
str9 = Strings.Split(str9, "</RegionName>", -1, CompareMethod.Binary)(0)
If (str9 = Nothing) Then
str9 = "-------------"
End If
Me.BricksLabel4.Text = str9
Dim str10 As String = Strings.Split(expression, "<RegionCode>", -1, CompareMethod.Binary)(1)
str10 = Strings.Split(str10, "</RegionCode>", -1, CompareMethod.Binary)(0)
If (str10 = Nothing) Then
str10 = "-------------"
End If
Me.BricksLabel5.Text = str10
Dim str As String = Strings.Split(expression, "<City>", -1, CompareMethod.Binary)(1)
str = Strings.Split(str, "</City>", -1, CompareMethod.Binary)(0)
If (str = Nothing) Then
str = "-------------"
End If
Dim str12 As String = Strings.Split(expression, "<ZipCode>", -1, CompareMethod.Binary)(1)
str12 = Strings.Split(str12, "</ZipCode>", -1, CompareMethod.Binary)(0)
If (str12 = Nothing) Then
str12 = "-------------"
End If
Me.BricksLabel7.Text = str12
Dim str11 As String = Strings.Split(expression, "<TimeZone>", -1, CompareMethod.Binary)(1)
str11 = Strings.Split(str11, "</TimeZone>", -1, CompareMethod.Binary)(0)
If (str11 = Nothing) Then
str11 = "-------------"
End If
Me.BricksLabel8.Text = str11
Dim str6 As String = Strings.Split(expression, "<Latitude>", -1, CompareMethod.Binary)(1)
str6 = Strings.Split(str6, "</Latitude>", -1, CompareMethod.Binary)(0)
If (str6 = Nothing) Then
str6 = "-------------"
End If
Me.BricksLabel9.Text = str6
Dim str7 As String = Strings.Split(expression, "<Longitude>", -1, CompareMethod.Binary)(1)
str7 = Strings.Split(str7, "</Longitude>", -1, CompareMethod.Binary)(0)
If (str7 = Nothing) Then
str7 = "-------------"
End If
Me.BricksLabel10.Text = str7
Dim str8 As String = Strings.Split(expression, "<MetroCode>", -1, CompareMethod.Binary)(1)
str8 = Strings.Split(str8, "</MetroCode>", -1, CompareMethod.Binary)(0)
If (str8 = Nothing) Then
str8 = "-------------"
End If
End Sub
Private Sub BricksButton1_Click(ByVal sender As Object, ByVal e As EventArgs)
Dim expression As String = Me.wg.DownloadString(("http://freegeoip.net/xml/" & Me.BricksTextbox1.Text))
Dim str5 As String = Strings.Split(expression, "<IP>", -1, CompareMethod.Binary)(1)
str5 = Strings.Split(str5, "</IP>", -1, CompareMethod.Binary)(0)
If (str5 = Nothing) Then
str5 = "-------------"
End If
Me.BricksLabel1.Text = str5
Dim str2 As String = Strings.Split(expression, "<CountryName>", -1, CompareMethod.Binary)(1)
str2 = Strings.Split(str2, "</CountryName>", -1, CompareMethod.Binary)(0)
If (str2 = Nothing) Then
str2 = "-------------"
End If
Me.BricksLabel2.Text = str2
Dim str3 As String = Strings.Split(expression, "<CountryCode>", -1, CompareMethod.Binary)(1)
str3 = Strings.Split(str3, "</CountryCode>", -1, CompareMethod.Binary)(0)
If (str3 = Nothing) Then
str3 = "-------------"
End If
Me.BricksLabel3.Text = str3
Dim client As New WebClient
Dim bitmap As Bitmap = DirectCast(Image.FromStream(New MemoryStream(client.DownloadData(("http://serverupload.altervista.org/flag/flat/" & str3 & ".png")))), Bitmap)
Me.PictureBox1.Image = bitmap
Dim str9 As String = Strings.Split(expression, "<RegionName>", -1, CompareMethod.Binary)(1)
str9 = Strings.Split(str9, "</RegionName>", -1, CompareMethod.Binary)(0)
If (str9 = Nothing) Then
str9 = "-------------"
End If
Me.BricksLabel4.Text = str9
Dim str10 As String = Strings.Split(expression, "<RegionCode>", -1, CompareMethod.Binary)(1)
str10 = Strings.Split(str10, "</RegionCode>", -1, CompareMethod.Binary)(0)
If (str10 = Nothing) Then
str10 = "-------------"
End If
Me.BricksLabel5.Text = str10
Dim str As String = Strings.Split(expression, "<City>", -1, CompareMethod.Binary)(1)
str = Strings.Split(str, "</City>", -1, CompareMethod.Binary)(0)
If (str = Nothing) Then
str = "-------------"
End If
Dim str12 As String = Strings.Split(expression, "<ZipCode>", -1, CompareMethod.Binary)(1)
str12 = Strings.Split(str12, "</ZipCode>", -1, CompareMethod.Binary)(0)
If (str12 = Nothing) Then
str12 = "-------------"
End If
Me.BricksLabel7.Text = str12
Dim str11 As String = Strings.Split(expression, "<TimeZone>", -1, CompareMethod.Binary)(1)
str11 = Strings.Split(str11, "</TimeZone>", -1, CompareMethod.Binary)(0)
If (str11 = Nothing) Then
str11 = "-------------"
End If
Me.BricksLabel8.Text = str11
Dim str6 As String = Strings.Split(expression, "<Latitude>", -1, CompareMethod.Binary)(1)
str6 = Strings.Split(str6, "</Latitude>", -1, CompareMethod.Binary)(0)
If (str6 = Nothing) Then
str6 = "-------------"
End If
Me.BricksLabel9.Text = str6
Dim str7 As String = Strings.Split(expression, "<Longitude>", -1, CompareMethod.Binary)(1)
str7 = Strings.Split(str7, "</Longitude>", -1, CompareMethod.Binary)(0)
If (str7 = Nothing) Then
str7 = "-------------"
End If
Me.BricksLabel10.Text = str7
Dim str8 As String = Strings.Split(expression, "<MetroCode>", -1, CompareMethod.Binary)(1)
str8 = Strings.Split(str8, "</MetroCode>", -1, CompareMethod.Binary)(0)
If (str8 = Nothing) Then
str8 = "-------------"
End If
End Sub