Okay, so this borrowed code is for doing a recursive file search. The
problem is when I encounter the System Volume Information folder, a special
kind of exception is thrown that ends up terminating the subroutine. I have
two other exceptions that are thrown before the one I described does, yet
they don't terminate the subroutine.
Can anyone tell me why one kind of exception terminates this subroutine,
while another does not?
Sub FileSearch(ByVa l sDir As String, ByVal FileName As String)
Dim Trigger As Integer = 0
Dim d2 As String
Dim f2 As String
If Trigger = 0 Then
Try
For Each d2 In Directory.GetDi rectories(sDir)
For Each f2 In Directory.GetFi les(d2, FileName)
MsgBox(f2, MsgBoxStyle.Cri tical, "File Found")
Next
FileSearch(d2, FileName)
Next
Catch excpt As UnauthorizedAcc essException
MsgBox(excpt.Me ssage)
End Try
End If
'MsgBox("Done")
End Sub
problem is when I encounter the System Volume Information folder, a special
kind of exception is thrown that ends up terminating the subroutine. I have
two other exceptions that are thrown before the one I described does, yet
they don't terminate the subroutine.
Can anyone tell me why one kind of exception terminates this subroutine,
while another does not?
Sub FileSearch(ByVa l sDir As String, ByVal FileName As String)
Dim Trigger As Integer = 0
Dim d2 As String
Dim f2 As String
If Trigger = 0 Then
Try
For Each d2 In Directory.GetDi rectories(sDir)
For Each f2 In Directory.GetFi les(d2, FileName)
MsgBox(f2, MsgBoxStyle.Cri tical, "File Found")
Next
FileSearch(d2, FileName)
Next
Catch excpt As UnauthorizedAcc essException
MsgBox(excpt.Me ssage)
End Try
End If
'MsgBox("Done")
End Sub
Comment