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:
  1. Try
  2.                     Dim dir As New System.IO.DirectoryInfo(TextBox7.Text)
  3.                     Dim md5 As New System.Security.Cryptography.MD5CryptoServiceProvider
  4.                     Dim hash As Array
  5.                     Dim i As Integer
  6.                     Dim files As Array
  7.                     Dim sb As New System.Text.StringBuilder
  8.                     files = dir.GetFiles
  9.                     For i = files.Length To files.GetUpperBound(0)
  10.                         Dim f As New System.IO.FileStream(i.ToString, IO.FileMode.Open)
  11.                         md5.ComputeHash(f)
  12.                         hash = md5.Hash
  13.                         For Each hashByte As Byte In hash
  14.                             sb.Append(String.Format("{0:X1}", hashByte))
  15.                         Next
  16.                         System.IO.File.AppendAllText(TextBox8.Text, sb.ToString)
  17.                         f.Close()
  18.                     Next
  19.                 Catch ex As Exception
  20.                     MessageBox.Show("An error occured while trying to generate a checksum!" & Environment.NewLine & ex.Message, "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error)
  21.                 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.