Click here to Skip to main content
16,004,927 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Increase Icon Size ofr list view Pin
Anonymous7-Jul-05 4:34
Anonymous7-Jul-05 4:34 
GeneralRecursive File Search Pin
Brad Fackrell6-Jul-05 16:57
Brad Fackrell6-Jul-05 16:57 
GeneralRe: Recursive File Search Pin
Christian Graus6-Jul-05 17:04
protectorChristian Graus6-Jul-05 17:04 
GeneralRe: Recursive File Search Pin
Brad Fackrell7-Jul-05 2:41
Brad Fackrell7-Jul-05 2:41 
GeneralRe: Recursive File Search Pin
Anonymous7-Jul-05 5:28
Anonymous7-Jul-05 5:28 
GeneralRe: Recursive File Search Pin
Brad Fackrell7-Jul-05 5:37
Brad Fackrell7-Jul-05 5:37 
GeneralRe: Recursive File Search Pin
Anonymous7-Jul-05 6:49
Anonymous7-Jul-05 6:49 
GeneralRe: Recursive File Search Pin
Anonymous7-Jul-05 9:53
Anonymous7-Jul-05 9:53 
Ignore what I just said, I reviewed the code from that link a little closer and you don't have to store the files found in an ArrayList. The recursive search does it for you already. Use the code as is and all you have to do is something like the following:

<br />
'Perhaps in a button event<br />
<br />
Dim x As New FileSearch(New IO.DirectoryInfo("C:\"), "*.config")<br />
<br />
'find all config files<br />
<br />
x.Search()<br />
<br />
'you should have all files that match "*.config" in C:\<br />
'the FileSearch class contains a public ArrayList Files<br />
'traverse the ArrayList and perform the action on the config file<br />
'for example:<br />
<br />
'go through each config file <br />
For Each obj as Object in x.Files<br />
<br />
<br />
  If obj.GetType() is GetType(FileInfo) Then<br />
<br />
'So why FileInfo? Because in the code provided on that forum<br />
'the author used the DirectoryInfo.GetFiles() function which<br />
'returns an array of FileInfo objects<br />
'2nd line of DoSearch()) - _Files.AddRange(BaseDirectory.GetFiles(_FileMask))<br />
<br />
'perform cast<br />
   Dim f as FileInfo = CType(obj, FileInfo)<br />
   'now perform the action on the file<br />
<br />
PerformAction(f)<br />
  End If<br />
'keep going until all config files have been handled<br />
Next<br />


You can however modify the author's code to make the Files ArrayList into an array of FileInfo objects which will all you to skip the casting and perform your "action" on the config file.

I hope this make sense?
GeneralRe: Recursive File Search Pin
Brad Fackrell7-Jul-05 10:53
Brad Fackrell7-Jul-05 10:53 
GeneralRe: Recursive File Search Pin
Anonymous7-Jul-05 11:09
Anonymous7-Jul-05 11:09 
GeneralRe: Recursive File Search Pin
Brad Fackrell7-Jul-05 11:13
Brad Fackrell7-Jul-05 11:13 
GeneralRe: Recursive File Search Pin
Brad Fackrell7-Jul-05 9:56
Brad Fackrell7-Jul-05 9:56 
GeneralRe: Recursive File Search Pin
Christian Graus7-Jul-05 13:09
protectorChristian Graus7-Jul-05 13:09 
GeneralRe: Recursive File Search Pin
Brad Fackrell7-Jul-05 13:15
Brad Fackrell7-Jul-05 13:15 
QuestionForgive my ignorance...populating a treeview from an access database? Pin
clabrett6-Jul-05 16:25
clabrett6-Jul-05 16:25 
AnswerRe: Forgive my ignorance...populating a treeview from an access database? Pin
progload7-Jul-05 9:52
progload7-Jul-05 9:52 
GeneralAxWebBrowser and Cookies Related Question Pin
The .Net Learner6-Jul-05 11:21
The .Net Learner6-Jul-05 11:21 
GeneralA string question Pin
Brad Fackrell6-Jul-05 11:01
Brad Fackrell6-Jul-05 11:01 
GeneralRe: A string question Pin
Anonymous6-Jul-05 11:11
Anonymous6-Jul-05 11:11 
GeneralRe: A string question Pin
Brad Fackrell6-Jul-05 11:43
Brad Fackrell6-Jul-05 11:43 
GeneralRe: A string question Pin
[Marc]6-Jul-05 13:25
[Marc]6-Jul-05 13:25 
GeneralRe: A string question Pin
Brad Fackrell6-Jul-05 13:27
Brad Fackrell6-Jul-05 13:27 
GeneralRe: A string question Pin
Christian Graus6-Jul-05 14:46
protectorChristian Graus6-Jul-05 14:46 
GeneralRe: A string question Pin
Anonymous6-Jul-05 15:18
Anonymous6-Jul-05 15:18 
GeneralRe: A string question Pin
[Marc]6-Jul-05 15:58
[Marc]6-Jul-05 15:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.