Here's the function that calculates the MD5 hash of a file:
[php]Public Function MD5CalcFile(ByVal filepath As String) As String
Using reader As New System.IO.FileStream(filepath, IO.FileMode.Open, IO.FileAccess.Read)
Using md5 As New System.Security.Cryptography.MD5CryptoServiceProvi der
Dim hash() As Byte = md5.ComputeHash(reader)
Return ByteArrayToString(hash)
End Using
End Using
End Function
[/php]
Convert the array to hex string:
[php]Private Function ByteArrayToString(ByVal arrInput() As Byte) As String
Dim sb As New System.Text.StringBuilder(arrInput.Length * 2)
For i As Integer = 0 To arrInput.Length - 1
sb.Append(arrInput(i).ToString("X2"))
Next
Return sb.ToString().ToLower
End Function
[/php]
Finally call the MD5CalcFile function to get the hash. Loop through all files and calculate it.
That does not help me in getting a updater to work =D
/Haz idea.
But go ahead and help xD
I don't know exactly, unfortunately, can you tell me? I've never done this before.