C# - XML Datei einlesen

Bizkit

Mitglied
HTML:
<?xml version="1.0"?>
<RDF:RDF xmlns:NC="http://home.netscape.com/NC-rdf#"
         xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
  <RDF:Description RDF:about="C:\Dokumente und Einstellungen\Grimms\Desktop\Firefox_Setup_2.0.0.1de.exe"
                   NC:Name="Firefox_Setup_2.0.0.1de.exe"
                   NC:DownloadAnimated="true"
                   NC:Transferred="5572KB von 5592KB">
    <NC:URL RDF:resource="http://212.162.61.160/downloads/529987/Firefox_Setup_2.0.0.1de.exe?1166620531-1166627731-a0a323-B-098d7943b000131c0a36bd7ac98e41e1.exe"/>
    <NC:File RDF:resource="C:\Dokumente und Einstellungen\Grimms\Desktop\Firefox_Setup_2.0.0.1de.exe"/>
    <NC:DateStarted NC:parseType="Date">Wed Dec 20 14:15:37 Westeuropäische Normalzeit 2006 +767827</NC:DateStarted>
    <NC:DateEnded NC:parseType="Date">Wed Dec 20 14:16:21 Westeuropäische Normalzeit 2006 +597686</NC:DateEnded>
    <NC:DownloadState NC:parseType="Integer">1</NC:DownloadState>
    <NC:ProgressPercent NC:parseType="Integer">100</NC:ProgressPercent>
  </RDF:Description>
  <RDF:Seq RDF:about="NC:DownloadsRoot">
    <RDF:li RDF:resource="C:\Dokumente und Einstellungen\Grimms\Desktop\Firefox_Setup_2.0.0.1de.exe"/>
    <RDF:li RDF:resource="C:\Dokumente und Einstellungen\Grimms\Desktop\TV-Browser 2 5 Beta 2 [found-on-www-bitreactor-to].torrent"/>
    <RDF:li RDF:resource="C:\Dokumente und Einstellungen\Grimms\Desktop\6000 C64-Games inklusive Emus( [found-on-www-bitreactor-to].torrent"/>
  </RDF:Seq>
  <RDF:Description RDF:about="C:\Dokumente und Einstellungen\Grimms\Desktop\6000 C64-Games inklusive Emus( [found-on-www-bitreactor-to].torrent"
                   NC:Name="6000 C64-Games inklusive Emus( [found-on-www-bitreactor-to].torrent"
                   NC:Transferred="0KB von  0KB">
    <NC:URL RDF:resource="http://bitreactor.to/download/471800"/>
    <NC:File RDF:resource="C:\Dokumente und Einstellungen\Grimms\Desktop\6000 C64-Games inklusive Emus( [found-on-www-bitreactor-to].torrent"/>
    <NC:DateStarted NC:parseType="Date">Wed Dec 20 14:14:10 Westeuropäische Normalzeit 2006 +905021</NC:DateStarted>
    <NC:DateEnded NC:parseType="Date">Wed Dec 20 14:14:10 Westeuropäische Normalzeit 2006 +905021</NC:DateEnded>
    <NC:DownloadState NC:parseType="Integer">1</NC:DownloadState>
    <NC:ProgressPercent NC:parseType="Integer">100</NC:ProgressPercent>
  </RDF:Description>
  <RDF:Description RDF:about="C:\Dokumente und Einstellungen\Grimms\Desktop\TV-Browser 2 5 Beta 2 [found-on-www-bitreactor-to].torrent"
                   NC:Name="TV-Browser 2 5 Beta 2 [found-on-www-bitreactor-to].torrent"
                   NC:Transferred="0KB von  0KB">
    <NC:URL RDF:resource="http://bitreactor.to/download/471877"/>
    <NC:File RDF:resource="C:\Dokumente und Einstellungen\Grimms\Desktop\TV-Browser 2 5 Beta 2 [found-on-www-bitreactor-to].torrent"/>
    <NC:DateStarted NC:parseType="Date">Wed Dec 20 14:14:17 Westeuropäische Normalzeit 2006 +920925</NC:DateStarted>
    <NC:DateEnded NC:parseType="Date">Wed Dec 20 14:14:17 Westeuropäische Normalzeit 2006 +936551</NC:DateEnded>
    <NC:DownloadState NC:parseType="Integer">1</NC:DownloadState>
    <NC:ProgressPercent NC:parseType="Integer">100</NC:ProgressPercent>
  </RDF:Description>
</RDF:RDF>

Das ist der Inhalt meiner XML Datei.
Es handelt sich hierbei um 3 Einträge die jeweils mit :<RDF: Description RDF:about= beginnen und bei </RDF: Description> enden.

Wie kann ich nun die werte zwischen diesen beiden Punkten auslesen

ich benötige den Wert von:
URL
File
DateStarted
DateEnded
DownloadState
ProgressPercent

Hab bisher noch keine Erfahrung mit XML, hoffe jemand kann mir helfen.

Gruß Simon
 
Hi,

Schau dir mal die Klassen im Namespace System.Xml an. Da im Speziellen die Klasse XmlDocument.
Die Methoden SelectNodes bzw. SelectSingleNodes sollten dir auch helfen.
 
Zurück