Hanashi Patcher V2 Problem VB .Net

11/06/2015 10:37 Du.ke#1
Hallo Liebe Com,

Ich habe folgendes Problem.

Da bei dem Patcher Source von Hanashi´s Patcher V2 ein Patchlister für den WebSpace dabei ist und er mir immer eine Leere List datei auswirft wollte ich mittels VB.Net einen Lister erstellen.

Das Problem dabei ist das der Lister von mir nicht genauso listet wie der von Hanashi bitte Helft mir Thanks.

Code zum erstellen der xml Liste:


Code:
 Private Sub BackgroundWorker1_DoWork(ByVal sender As System.Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles BackgroundWorker1.DoWork
        If BackgroundWorker1.CancellationPending = True Then
            BackgroundWorker1.CancelAsync()
        End If
        Dim Files As List(Of String) = GetFiles(My.Computer.FileSystem.CurrentDirectory & "\", True)

        Dim XmlDoc As New XmlDocument

        'Write down the XML declaration
        Dim XmlDeclaration As XmlDeclaration = XmlDoc.CreateXmlDeclaration("1.0", "UTF-8", Nothing)

        'Create the root element
        Dim RootNode As XmlElement = XmlDoc.CreateElement("PatchList")
        XmlDoc.InsertBefore(XmlDeclaration, XmlDoc.DocumentElement)
        XmlDoc.AppendChild(RootNode)

        'Create a new <Category> element and add it to the root node
        Dim ParentNode As XmlElement = XmlDoc.CreateElement("PatchFiles")

        'Set attribute name and value!


        XmlDoc.DocumentElement.PrependChild(ParentNode)

        'Create the required nodes


        For Each File In Files
            If File.Contains(Process.GetCurrentProcess.MainModule.FileName) Then

            Else

                Dim Checksum As String = MD5FileHash(File)
                Dim Dateiname As String = File.Replace(My.Computer.FileSystem.CurrentDirectory & "\", "")

                Label1.Text = "Aktuelle Datei: " & Dateiname
                Dim FirstElement As XmlElement = XmlDoc.CreateElement("Name")
                Dim SecondElement As XmlElement = XmlDoc.CreateElement("Hash")


                'retrieve the text
                Dim FirstTextElement As XmlText = XmlDoc.CreateTextNode(Dateiname)
                Dim SecondTextElement As XmlText = XmlDoc.CreateTextNode(Checksum)

                'append the nodes to the parentNode without the value
                ParentNode.AppendChild(FirstElement)
                ParentNode.AppendChild(SecondElement)


                'save the value of the fields into the nodes
                FirstElement.AppendChild(FirstTextElement)
                SecondElement.AppendChild(SecondTextElement)

            End If
        Next
        Label1.Text = "Erstellt!"
        'Save to the XML file
        XmlDoc.Save("demo.xml")

    End Sub

So sieht sie dann aus:

Code:
<?xml version="1.0" encoding="UTF-8"?>
<PatchList>
  <PatchFiles>
    <Name>Mt2-Patchlistgenerator.pdb</Name>
    <Hash>C6722CC9358A4CE878DEEE212FFBC2DD</Hash>
    <Name>Mt2-Patchlistgenerator.vshost.exe</Name>
    <Hash>5A96850B84A268CA84018F1A9F6BB59</Hash>
    <Name>Mt2-Patchlistgenerator.vshost.exe.manifest</Name>
    <Hash>A19A2658BA69006AC9D11FD7D7E3C1</Hash>
    <Name>Mt2-Patchlistgenerator.xml</Name>
    <Hash>C1576D0781684F96BD2889DB09F876B</Hash>
    <Name>Patchlistgenerator by Kryter.exe</Name>
    <Hash>F34B16A592FA3D74F17EA62A48C09CF8</Hash>
    <Name>Patchlistgenerator by Kryter.pdb</Name>
    <Hash>7E5E0A11CCF1056D2FDC9B9EFF5E138</Hash>
    <Name>Patchlistgenerator by Kryter.xml</Name>
    <Hash>08E100ED60010140EDB81FABE7A9</Hash>
  </PatchFiles>
</PatchList>
Aussehen soll Sie aber so:

Code:
<?xml version="1.0" encoding="utf-8"?>
<PatchList>
  <PatchFiles>
    <PatchFile>
      <Name>local.eix</Name>
      <Hash>b83e83a8169acfe9b7a43191da2a7b3c</Hash>
    </PatchFile>
    <PatchFile>
      <Name>local.epk</Name>
      <Hash>b83e83a8169acfe9b7a43191da2a7b3c</Hash>
    </PatchFile>
    <PatchFile>
      <Name>pack\root.eix</Name>
      <Hash>1970e1498315995be5233bccc8042b4d</Hash>
    </PatchFile>
    <PatchFile>
      <Name>pack\root.epk</Name>
      <Hash>b83e83a8169acfe9b7a43191da2a7b3c</Hash>
    </PatchFile>
  </PatchFiles>
</PatchList>
Bitte Helft mir :/ Nutze den Source von Kryter und habe versucht ihn um zu scripten.
11/06/2015 11:35 Mi4uric3#2
[Only registered and activated users can see links. Click Here To Register...]

Das ist dir nicht zufällig über den Weg gelaufen, als du diesen Thread erstellt hast, oder..?
11/06/2015 11:56 Du.ke#3
oh sry >.< einfach durchgeklickt..
11/06/2015 12:09 Jinbei#4
#moved…
11/06/2015 14:56 jubox123#5
Guck dir doch einfach mal auf Google an wie XML in VB geht.
Und warum XML, geht auch einfacher und kleiner ohne XML. z.B so:
pack/test.eix|b83e83a8169acfe9b7a43191da2a7b3c
pack/test.epk|A19A2658BA69006AC9D11FD7D7E3C1