Hallo!
Ich wollte fragen wie ich diese XML Datei:
So auswerten kann dass in einer Listbox das hier steht:
und wenn man dann das ausgewählte Item anklickt dass ich ein DLLink Returnt bekomme (Bei der XML Datei das was bei <Download> steht)
Spoiler anzeigen
EDIT:
Spoiler anzeigen
Ich wollte fragen wie ich diese XML Datei:
So auswerten kann dass in einer Listbox das hier steht:
und wenn man dann das ausgewählte Item anklickt dass ich ein DLLink Returnt bekomme (Bei der XML Datei das was bei <Download> steht)
Visual Basic-Quellcode
- Private Sub ReadIndex()
- 'check if file myxml.xml is existing
- If (IO.File.Exists(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\Easy Bukkit\servers.xml")) Then
- 'create a new xmltextreader object
- 'this is the object that we will loop and will be used to read the xml file
- Dim document As XmlReader = New XmlTextReader(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\Easy Bukkit\servers.xml")
- 'loop through the xml file
- While (document.Read())
- Dim type = document.NodeType
- 'if node type was element
- If (type = XmlNodeType.Element) Then
- 'if the loop found a <FirstName> tag
- If (document.Name = "Name") Then
- ListBox3.Items.Add(document.ReadInnerXml.ToString())
- End If
- 'if the loop found a <LastName tag
- If (document.Name = "LastName") Then
- MsgBox(document.ReadInnerXml.ToString())
- End If
- End If
- End While
- Else
- MessageBox.Show("The filename you selected was not found.")
- End If
- End Sub
- Private Function ReadIndexDL() As String
- 'check if file myxml.xml is existing
- If (IO.File.Exists(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\Easy Bukkit\servers.xml")) Then
- 'create a new xmltextreader object
- 'this is the object that we will loop and will be used to read the xml file
- Dim document As XmlReader = New XmlTextReader(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\Easy Bukkit\servers.xml")
- 'loop through the xml file
- While (document.Read())
- Dim type = document.NodeType
- 'if node type was element
- If (type = XmlNodeType.Element) Then
- 'if the loop found a <FirstName> tag
- If (document.Name = "Download") Then
- Return document.ReadInnerXml.ToString
- End If
- End If
- End While
- Else
- Return "OFF"
- End If
- Return "OFF"
- End Function
EDIT:
Gin auch nicht
Visual Basic-Quellcode
- Private Function ReadIndexDL(ByVal item As String) As String
- 'check if file myxml.xml is existing
- If (IO.File.Exists(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\Easy Bukkit\servers.xml")) Then
- 'create a new xmltextreader object
- 'this is the object that we will loop and will be used to read the xml file
- Dim document As XmlReader = New XmlTextReader(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\Easy Bukkit\servers.xml")
- 'loop through the xml file
- While (document.Read())
- Dim type = document.NodeType
- 'if node type was element
- If (type = XmlNodeType.Element) Then
- If document.Name = item Then
- If (document.Name = "Download") Then
- Return document.ReadInnerXml.ToString
- End If
- End If
- End If
- End While
- Else
- Return "OFF"
- End If
- Return "OFF"
- End Function
Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von „TheSCHFan#“ ()