I keep getting an Expression Expected Error in this first section with both the ByVal underlined. Im simply trying to call the Encrypt Sub... I am loosing my mind with this. I tryed just
Encrypt() but then I get errors about the System.IO.FileSystemEventArgs not being including in the call....

If anyone has some ideas please share.


VB Code:
  1. Private Sub btnEncrypt_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnEncrypt.Click
  2.  
  3.         'Call the first encryption method with the error handler.
  4.  
  5.         Encrypt(ByVal sender As System.Object, ByVal e As System.IO.FileSystemEventArgs)
  6.  
  7.  
  8.     End Sub


Here is the Encrypt sub that I am trying to call. Everything here is fine.


VB Code:
  1. Public Sub Encrypt(ByVal sender As System.Object, ByVal e As System.IO.FileSystemEventArgs)
  2.         'Ignore the temp files that are being encrpyted.
  3.         If System.IO.Path.GetExtension(e.FullPath) = tempExt Then Exit Sub
  4.  
  5.  
  6.         Do
  7.             Try
  8.                 'Encrypt the file that is being created.
  9.                 EncryptFile(e.FullPath, pwBytes)
  10.                 ' Exit if successful
  11.                 Exit Do
  12.             Catch ex As Exception
  13.                 Dim attempts As Integer
  14.                 attempts += 1
  15.                 ' Make up to 10 attempts.
  16.                 If attempts > 10 Then Exit Sub
  17.                 ' Wait for a while and retry the operation.
  18.                 System.Threading.Thread.Sleep(1000)
  19.             End Try
  20.         Loop
  21.  
  22.     End Sub