[Help] MD5 Updater
As the title says, I'm searching for an updater that uses md5 hashes. Meaning like if I have 20 different files on my ftp...it does compare the md5 hashes and updates if necessary...
Any suggestions <.<?
This is what I've found so far:
Any suggestions <.<?
This is what I've found so far:
Code:
Public Sub CheckSumAndRun(ByVal filename As String)
Try
f = New System.IO.FileStream(filename, System.IO.FileMode.Open, System.IO.FileAccess.Read, System.IO.FileShare.Read, 8192)
Catch ex As Exception
MsgBox(ex.Message)
Exit Sub
End Try
md5 = New System.Security.Cryptography.MD5CryptoServiceProvider
md5.ComputeHash(f)
Dim hash As Byte() = md5.Hash
Dim buff As System.Text.StringBuilder = New System.Text.StringBuilder
Dim hashByte As Byte
For Each hashByte In hash
buff.Append(String.Format("{0:X2}", hashByte))
Next
f.Close()
If buff.ToString = main_md5 Then
p = Diagnostics.Process.Start(main_name, MainStartParam)
Me.Close()
Else
If My.Computer.FileSystem.FileExists(currdir & main_name) = True Then
My.Computer.FileSystem.DeleteFile(currdir & main_name, FileIO.UIOption.OnlyErrorDialogs, FileIO.RecycleOption.DeletePermanently)
End If
wrong_main = True
BackgroundWorker1.RunWorkerAsync()
End If
End Sub


!!