Imports System.IO
Imports System.Security.Cryptography
Public Shared Function _MD5(ByVal strSource As String) As String
Dim fstream As New FileStream(strSource, FileMode.Open, FileAccess.Read)
Dim dataToHash(fstream.Length - 1) As Byte
fstream.Read(dataToHash, 0, fstream.Length)
fstream.Close()
Dim hashvalue As Byte() = CType(CryptoConfig.CreateFromName("MD5"), HashAlgorithm).ComputeHash(dataToHash)
Dim i As Integer
Dim result As String = ""
For i = 0 To hashvalue.Length - 1
result += Hex(hashvalue(i)).ToLower
Next
Return result
End Function