VB 2005 File System Searching

How to search files and sub directories in VB 2005

Page 1 of 1

1 Replies - 5575 Views - Last Post: 12 June 2008 - 04:14 PM Rate Topic: -----

#1 TheOne_upg  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 02-March 08

VB 2005 File System Searching

Post icon  Posted 06 March 2008 - 12:06 PM

I got a problem while making an Windows Explorer style Form to browse files and folders. Now i m just checking out the result of the code as ;
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

searchResults = My.Computer.FileSystem.GetFiles(directory, FileIO.SearchOption.SearchAllSubDirectories, wildCards)

Catch ex As UnauthorizedAccessException
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.


Is This A Good Question/Topic? 0
  • +

Replies To: VB 2005 File System Searching

#2 Damage  Icon User is offline

  • Lord of Schwing
  • member icon

Reputation: 300
  • View blog
  • Posts: 1,989
  • Joined: 05-June 08

Re: VB 2005 File System Searching

Posted 12 June 2008 - 04:14 PM

hey i'm trying the exact same thing, i'll let you know how it goes
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1