Hello, I'm working on a new version of my old SecureMD5 program (which you may have seen on download.com or softpedia). One of the new features is Recursive Generation.
The program loops through each file in a folder and generates a checksum for it. Then it places the checksums in a file.
The only problem is... nothing happens. I click Generate, and the programs just sits there and does nothing. Here's my code for the Generate button:
VB Code:
Try Dim dir As New System.IO.DirectoryInfo(TextBox7.Text) Dim md5 As New System.Security.Cryptography.MD5CryptoServiceProvider Dim hash As Array Dim i As Integer Dim files As Array Dim sb As New System.Text.StringBuilder files = dir.GetFiles For i = files.Length To files.GetUpperBound(0) Dim f As New System.IO.FileStream(i.ToString, IO.FileMode.Open) md5.ComputeHash(f) hash = md5.Hash For Each hashByte As Byte In hash sb.Append(String.Format("{0:X1}", hashByte)) Next System.IO.File.AppendAllText(TextBox8.Text, sb.ToString) f.Close() Next Catch ex As Exception MessageBox.Show("An error occured while trying to generate a checksum!" & Environment.NewLine & ex.Message, "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error) End Try
TextBox7 is the textbox for the folder path and TextBox8 is the textbox for the output file (with the checksums). Just thought you might need to know that.




Reply With Quote