Reading the XML

Discussion in 'Bukkit Help' started by xTom, Jul 16, 2012.

Thread Status:
Not open for further replies.
  1. Offline


    I'm using to create a server wrapper, and I'm trying to get the download URL of each channel from this XML. This is what I have so far:
            Dim request As System.Net.HttpWebRequest = System.Net.HttpWebRequest.Create("")
            Dim response As System.Net.HttpWebResponse = request.GetResponse()
            ' Check if the response is OK (status code 200)
            If response.StatusCode = System.Net.HttpStatusCode.OK Then
                ' Parse the contents from the response to a stream object
                Dim stream As System.IO.Stream = response.GetResponseStream()
                ' Create a reader for the stream object
                Dim reader As New System.IO.StreamReader(stream)
                ' Read from the stream object using the reader, put the contents in a string
                Dim contents As String = reader.ReadToEnd()
                ' Create a new, empty XML document
                Dim document As New System.Xml.XmlDocument()
                ' Load the contents into the XML document
                ' If the call to the remote site fails
                ' See the codes in the System.Net.HttpStatusCode enumerator
                Throw New Exception("Could not retrieve document from the URL, response code: " & response.StatusCode)
            End If
    I think I have the XML loaded into memory but I have not a clue on how to get the specific node data.
    Sorry if this is the wrong board and thanks for any help!

  2. Offline


  3. Offline


Thread Status:
Not open for further replies.

Share This Page