dim md5str as string
Using reader As New System.IO.FileStream(filepath, IO.FileMode.Open, IO.FileAccess.Read)
Using md5 As New System.Security.Cryptography.MD5CryptoServiceProvider
Dim hash() As Byte = md5.ComputeHash(reader)
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
md5str = sb.ToString().ToLower
End Using
End Using
MessageBox.show(md5str)
判断两个文件的MD5值是否一样即可.
可以建立一个表保存远程文件的的MD5值 用来做对比.