Click to See Complete Forum and Search --> : Recursively retrieve files in a folder
virux
Jul 31st, 2000, 01:08 AM
hi!
anybody who knows how to to recursively retrieve the file names found inside a particular folder?
IrishJoker
Jul 31st, 2000, 06:21 AM
Use the FindFirstFile and the FindNextFile API functions.
There is a good example on http://www.vbapi.com.
Hope that is some help.
IJ
virux
Jul 31st, 2000, 09:22 PM
actually i've found a way to my problem. for this piece of code to work, you must have 2 file list box on a form, called UploadedFile and CheckedFile. it will retrieve the first file from UploadedFile, process it and move it over to CheckedFile. in this way i can get hold to each of the file, one at a time. one feature that i wanted to achieve has been successful too: to add files while i'm processing a file at the same time. that's why i've the Refresh function to constantly check if there's any new file.
Private Sub Start_Click()
On Error Resume Next
UploadedFile.Refresh
UploadedFile.ListIndex = 0
While UploadedFile.ListCount > 0
'Process the first file here
FileCopy Source, Destination
Kill Source
UploadedFile.Refresh
UploadedFile.ListIndex = 0
CheckedFile.Refresh
Wend
End Sub
Mad Compie
Aug 5th, 2000, 04:51 AM
Yes of course, I will send you the algorithm if you want.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.