Advertisement
qiangqiang101

xml

Nov 2nd, 2017
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. Private Sub ImportToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles ImportToolStripMenuItem.Click
  2. Try
  3. If ofDialog.ShowDialog = DialogResult.OK Then
  4. For Each file As String In ofDialog.FileNames
  5. Dim vehicles As New XmlDocument()
  6. vehicles.Load(file)
  7. Using items As XmlNodeList = vehicles.DocumentElement.SelectNodes("/CVehicleModelInfoVarGlobal/Kits/Item")
  8. For Each item As XmlNode In items
  9. Dim kitname As String = item.SelectSingleNode("kitName").InnerText
  10. Dim id As String = item.SelectSingleNode("id").Attributes(0).Value
  11. Dim temp() As String = Split(kitname, "_", -1)
  12. Dim vehName As String = temp(1)
  13. Dim kittype As String = item.SelectSingleNode("kitType").InnerText
  14.  
  15. AddItem(id, vehName, kitname, kittype)
  16. Next
  17. End Using
  18. Next
  19. End If
  20. Catch ex As Exception
  21. MsgBox(ex.Message & " " & ex.StackTrace, MsgBoxStyle.Critical, "VKID Tool")
  22. End Try
  23. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement