Hi all,
I've got this block of code here:
Try
files = My.Computer.FileSystem.GetFiles("C:\", FileIO.SearchOption.SearchAllSubDirectories, "*.*")
Catch ex As UnauthorizedAccessException
End Try
It will throw that UnauthorizedAccessException when it hits random folders I don't have access to (system-only folders, etc). What ends up happening, though, is that it just gives up and gets out of the Try-Catch (by design, I'm sure).
My question is: how do I make it keep going and continue to build the collection? Any help would be appreciated. Thanks all,
I've got this block of code here:
Try
files = My.Computer.FileSystem.GetFiles("C:\", FileIO.SearchOption.SearchAllSubDirectories, "*.*")
Catch ex As UnauthorizedAccessException
End Try
It will throw that UnauthorizedAccessException when it hits random folders I don't have access to (system-only folders, etc). What ends up happening, though, is that it just gives up and gets out of the Try-Catch (by design, I'm sure).
My question is: how do I make it keep going and continue to build the collection? Any help would be appreciated. Thanks all,
