vb@rchiv
VB Classic
VB.NET
ADO.NET
VBA
C#
Schützen Sie Ihre Software vor Software-Piraterie - mit sevLock 1.0 DLL!  
 vb@rchiv Quick-Search: Suche startenErweiterte Suche starten   Impressum  | Datenschutz  | vb@rchiv CD Vol.6  | Shop Copyright ©2000-2025
 
zurück

 Sie sind aktuell nicht angemeldet.Funktionen: Einloggen  |  Neu registrieren  |  Suchen

VB.NET - Fortgeschrittene
XML-Datei auslesen 
Autor: Maxro
Datum: 05.08.07 20:19

hy leutz ..

Ich Versuche eine Xml-Datei mit folgendem Inhalten (tags) auszulesen :

XML :
- <Title>
  <id>01-4_clubbers_feat_silvy_-_time_(the_hitmen_remix).mp3</id> 
  <id>01-apollo_-_dance_2007__megara_vs_dj_lee_remix_---www.technorocker._
    info.mp3</id> 
  <id>01-bangboy_vs_hansebanger_-_hamburg_city_( _
  club_mix)---www.technorocker.info.mp3</id> 
...
...
..
..
....
<id>[TECHNO HARDCORE] speedcore__style__gabba nation__ron d _
  core__shockwave__strike__DOA mix by dj VAnUX.mp3</id> 
  </Title>
hier mein Code :

        Private Sub Button11_Click(ByVal sender As System.Object, ByVal e As _
          System.EventArgs) Handles Button11.Click
 
        Dim xmlList As New Xml.XmlDocument()
        xmlList.Load("Maxro05.08.2007.xml")
        Dim Id As String
        Id = xmlList.DocumentElement.Name
        Dim anzahl As Integer
        Dim counter As Integer = 0
        anzahl = xmlList.DocumentElement.ChildNodes.Count()
 
again:  If counter = (anzahl - 1) Then
            Me.ListBox1.Items.Add(xmlList.DocumentElement.ChildNodes( _
              counter).Value)
        Else
            counter += 1
            Me.ListBox1.Items.Add(xmlList.DocumentElement.ChildNodes( _
              counter).Value)
            GoTo again
        End If
    End Sub
Der Code soll mehr jeden einzelnen Inhalt einer <id>..</id> in die ListBox1 packen (pro id 1 ListBox Item)

Nur allerdings bekomme ich bei meinem Code Folgenden fehler :

System.ArgumentNullException wurde nicht behandelt.
Message="Der Wert darf nicht NULL sein.
Parametername: item"
ParamName="item"
Source="System.Windows.Forms"
StackTrace:
bei System.Windows.Forms.ListBox.ObjectCollection.AddInternal(Object item)
bei System.Windows.Forms.ListBox.ObjectCollection.Add(Object item)
bei WindowsApplication6.Form1.Button11_Click(Object sender, EventArgs e) in C:\Dokumente und Einstellungen\Maxro\Eigene Dateien\Visual Studio 2005\Projects\WindowsApplication6\WindowsApplication6\Form1.vb:Zeile 201.
bei System.Windows.Forms.Control.OnClick(EventArgs e)
bei System.Windows.Forms.Button.OnClick(EventArgs e)
bei System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
bei System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
bei System.Windows.Forms.Control.WndProc(Message& m)
bei System.Windows.Forms.ButtonBase.WndProc(Message& m)
bei System.Windows.Forms.Button.WndProc(Message& m)
bei System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
bei System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
bei System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
bei System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
bei System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
bei System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
bei System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
bei System.Windows.Forms.Application.Run(ApplicationContext context)
bei Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
bei Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
bei Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
bei WindowsApplication6.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:Zeile 81.
bei System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
bei System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
bei Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
bei System.Threading.ThreadHelper.ThreadStart_Context(Object state)
bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
bei System.Threading.ThreadHelper.ThreadStart()

Ich hoffe jemand kann mir weiterhelfen !
alle Nachrichten anzeigenGesamtübersicht  |  Zum Thema  |  Suchen

 ThemaViews  AutorDatum
XML-Datei auslesen1.031Maxro05.08.07 20:19
Re: XML-Datei auslesen527Maxro06.08.07 13:59
Re: XML-Datei auslesen540Melkor06.08.07 14:21
Re: XML-Datei auslesen522Melkor06.08.07 14:25
Re: XML-Datei auslesen513Maxro06.08.07 14:45

Sie sind nicht angemeldet!
Um auf diesen Beitrag zu antworten oder neue Beiträge schreiben zu können, müssen Sie sich zunächst anmelden.

Einloggen  |  Neu registrieren

Funktionen:  Zum Thema  |  GesamtübersichtSuchen 

nach obenzurück
 
   

Copyright ©2000-2025 vb@rchiv Dieter Otter
Alle Rechte vorbehalten.
Microsoft, Windows und Visual Basic sind entweder eingetragene Marken oder Marken der Microsoft Corporation in den USA und/oder anderen Ländern. Weitere auf dieser Homepage aufgeführten Produkt- und Firmennamen können geschützte Marken ihrer jeweiligen Inhaber sein.

Diese Seiten wurden optimiert für eine Bildschirmauflösung von mind. 1280x1024 Pixel