lothos12345 Posted May 25, 2005 Posted May 25, 2005 I have a vb.net application with an openfiledialog control on the form with a filter for .mdb's. The user selects the database and the filename property of the dialog box puts the path in a textbox on the form. What I also need the program to do is perform a recursive search for tif's starting in the directory where the database is located in and search all the directories that might be below the directory of the database. Any programming examples of how to accomplish this task is greatly appreciated. Quote
splice Posted May 27, 2005 Posted May 27, 2005 I have a vb.net application with an openfiledialog control on the form with a filter for .mdb's. The user selects the database and the filename property of the dialog box puts the path in a textbox on the form. What I also need the program to do is perform a recursive search for tif's starting in the directory where the database is located in and search all the directories that might be below the directory of the database. Any programming examples of how to accomplish this task is greatly appreciated. Imports System.IO Public Class FindFiles Public Shared Function FindFiles(ByVal basePath As String, ByVal searchPattern As String) As ArrayList Dim result As New ArrayList For Each dir As String In Directory.GetDirectories(basePath) result.AddRange(FindFiles(dir, searchPattern)) Next For Each file As String In Directory.GetFiles(basePath, searchPattern) result.Add(file) Next Return result End Function End Class Called like so: Dim result As ArrayList = FindFiles.FindFiles("some directory", "*.tif") Quote -=splice=- It's not my fault I'm a Genius!
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.