Please Help. Expression Expteted with ByVal Sub Call
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:
Private Sub btnEncrypt_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnEncrypt.Click
'Call the first encryption method with the error handler.
Encrypt(ByVal sender As System.Object, ByVal e As System.IO.FileSystemEventArgs)
End Sub
Here is the Encrypt sub that I am trying to call. Everything here is fine.
VB Code:
Public Sub Encrypt(ByVal sender As System.Object, ByVal e As System.IO.FileSystemEventArgs)
'Ignore the temp files that are being encrpyted.
If System.IO.Path.GetExtension(e.FullPath) = tempExt Then Exit Sub
Do
Try
'Encrypt the file that is being created.
EncryptFile(e.FullPath, pwBytes)
' Exit if successful
Exit Do
Catch ex As Exception
Dim attempts As Integer
attempts += 1
' Make up to 10 attempts.
If attempts > 10 Then Exit Sub
' Wait for a while and retry the operation.
System.Threading.Thread.Sleep(1000)
End Try
Loop
End Sub