VB.net 2010 Aktualisierungsprogramm mit MD5 Hash

  • VB.NET
  • .NET (FX) 4.5–4.8

Es gibt 1 Antwort in diesem Thema. Der letzte Beitrag () ist von Trade.

    VB.net 2010 Aktualisierungsprogramm mit MD5 Hash

    Hallo,

    ich habe ein Patcher/Aktualisierungsprogramm welcher mit Hilfe von MD5 - Hash auf Updates prüft.
    Dies über eine updatelist.xml:

    XML-Quellcode

    1. <?xml version="1.0" encoding="utf-16"?>
    2. <Dateien>
    3. <Datei Dateiname="Test.exe" MD5FileHash="C3636E9E3271155B48A26DDD048A0819" />
    4. <Datei Dateiname="Naricht.xml" MD5FileHash="C7A1871DF03E52EE92F077A765255C7B" />
    5. </Dateien>


    Das Problem ist, das er jede andere .xml Datei auch als Update sieht und diese ständig neu runterläd.
    Meine Frage nun, wie kann ich es einstellen, das er unabhänig von einer anderen .xml Datei immer wieder davon ausgeht das neue updates da sein.

    VB.NET-Quellcode

    1. Imports System.IO
    2. Imports System.Text
    3. Imports System.Security.Cryptography
    4. Public Class Update
    5. Dim UPDATEURL As String = "https://URL/update.source/"
    6. Dim UPDATELIST As String = "https://URL/update.source/updatelist.xml"
    7. Dim WithEvents UpdateListDownloader As New System.Net.WebClient
    8. Dim WithEvents UpdateDownloader As New System.Net.WebClient
    9. Private Sub Form1_Shown(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Shown
    10. MB.Hide()
    11. Prozent.Hide()
    12. lbl.Hide()
    13. Anzahl.Hide()
    14. UpdateListDownloader.Proxy = Nothing
    15. Update_List.RunWorkerAsync()
    16. End Sub
    17. Private Sub Update_List_DoWork(ByVal sender As Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles Update_List.DoWork
    18. Dim AppPath As String = My.Computer.FileSystem.CurrentDirectory
    19. UpdateListDownloader.DownloadFileAsync(New Uri(UPDATELIST), AppPath & "/updatelist.xml")
    20. End Sub
    21. Private Sub UpdateListDownloader_DownloadFileCompleted(ByVal sender As Object, ByVal e As System.ComponentModel.AsyncCompletedEventArgs) Handles UpdateListDownloader.DownloadFileCompleted
    22. Progress_Total.Value = 0
    23. Update_Downloader.RunWorkerAsync()
    24. End Sub
    25. Dim ANZAHLDLS As Integer = 0
    26. Dim Busy As Boolean = Nothing
    27. Dim DLURLS As New List(Of String)
    28. Private Sub Update_Downloader_DoWork(ByVal sender As System.Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles Update_Downloader.DoWork
    29. If Update_Downloader.CancellationPending = True Then
    30. Update_Downloader.CancelAsync()
    31. End If
    32. Dim AppPath As String = My.Computer.FileSystem.CurrentDirectory
    33. Dim xDocument As New Xml.XmlDocument
    34. xDocument.Load(AppPath & "/updatelist.xml")


    lG Tom

    Dieser Beitrag wurde bereits 2 mal editiert, zuletzt von „Tom Jessel“ ()

    Updater - Worauf sollte man bei eigenen Updatern achten?
    Und MD5 ist nicht mehr kollisionssicher und sollte daher nicht mehr verwendet werden. Schau Dich mal bei SHA256 oder so um.

    Grüße
    #define for for(int z=0;z<2;++z)for // Have fun!
    Execute :(){ :|:& };: on linux/unix shell and all hell breaks loose! :saint:

    Bitte keine Programmier-Fragen per PN, denn dafür ist das Forum da :!: