Code in VB 2005
Private Sub BackgroundWorker1_DoWork(ByVal sender As Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles BackgroundWorker1.DoWork 'On Error Resume Next Try searchResults = My.Computer.FileSystem.GetFiles(directory, FileIO.SearchOption.SearchAllSubDirectories, wildCards) 'UnauthorizedAccessException Catch ex As UnauthorizedAccessException 'MessageBox.Show(ex.Message) End Try End Sub
this code throws the following exceptions of "UnauthorizedAccessException"
But i want to search through all the directories and subdirectories. If there some files or subdirectories where there is no user access allowed i want to continue searching bypassing that directory or subdirectory.
So that i could make a complete search of files and folders and make that Explorer Style interface.