D
Daniel
Hi group.
Any ideas how I could speed up/streamline the below code? Particuarly,
is there a way to use a progress bar for when it calculates the MD5?
Currently it just looks like it is hung for large files.
Private Function MakeMD5(srcFileName as String)
Dim DBfs As FileStream
Dim byt() As Byte
If (New FileInfo(srcFileName).Exists) Then
Try
Dim md5 As New MD5CryptoServiceProvider
DBfs = File.Open(srcFileName, FileMode.Open,
_FileAccess.Read, FileShare.ReadWrite)
byt = md5.ComputeHash(DBfs)
Return (BitConverter.ToString(byt))
Catch ex As Exception
Msgbox(ex.Message)
Finally '
If (Not IsNothing(DBfs)) Then DBfs.Close()
End Try
End If
End Function
Any ideas how I could speed up/streamline the below code? Particuarly,
is there a way to use a progress bar for when it calculates the MD5?
Currently it just looks like it is hung for large files.
Private Function MakeMD5(srcFileName as String)
Dim DBfs As FileStream
Dim byt() As Byte
If (New FileInfo(srcFileName).Exists) Then
Try
Dim md5 As New MD5CryptoServiceProvider
DBfs = File.Open(srcFileName, FileMode.Open,
_FileAccess.Read, FileShare.ReadWrite)
byt = md5.ComputeHash(DBfs)
Return (BitConverter.ToString(byt))
Catch ex As Exception
Msgbox(ex.Message)
Finally '
If (Not IsNothing(DBfs)) Then DBfs.Close()
End Try
End If
End Function