[Help] Get XML Info
Example, I got a webpage in xml with this:
How i get the info what is in the <ip> ?
Code:
<ip_address> <ip>89.181.133.153</ip> </ip_address>
<ip_address> <ip>89.181.133.153</ip> </ip_address>
Function IP()
Dim myIP As String = ""
Dim xmlR As New XmlTextReader(WebBrowser1.Document.Body.InnerText)
xmlR.ReadToFollowing("ip_adress")
myIP = xmlR.ReadContentAsString
Return myIP
End Function
Private Function ip()
Dim myIp As String = ""
Using XmlRead As New XmlTextReader("http://www.domaintools.com/research/my-ip/myip.xml/")
XmlRead.ReadToFollowing("ip_address")
myIp = XmlRead.ReadElementContentAsString
End Using
Return myIp.ToString
End Function
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
txtIP.Text = ip()
End Sub