I thought much but and have not found a beautiful way...
how can i find ALL files in given dir?include subdirs
__________________
I'll Kill you, I'll Crash you, I'll never be yours!
--------------------------------------------------
Qtek s110; o2 XDA Flame; Nokia E63 red;
ASUS Eee PC 901 (Windows XP sp3) + TouchScreen;
Greating Flippo)i'm work with soirce of your explorer but not find,how can i do it.you find files in subfolder when click it.but i must find all files at once
__________________
I'll Kill you, I'll Crash you, I'll never be yours!
--------------------------------------------------
Qtek s110; o2 XDA Flame; Nokia E63 red;
ASUS Eee PC 901 (Windows XP sp3) + TouchScreen;
Adds all subdirectories matching the search pattern in the specified path to an ArrayList and returns the number found.
Syntax: DirSearch (ArrayList, Path [,Search Pattern])
If the Search Pattern is omitted DirSearch will return all the subdirectories in the directory.
Search Pattern can include '*' and '?'.
* - Finds zero or more characters.
? - Finds exactly one character.
Example: (alDir is an ArrayList control)
FileSearch (alDir, "\My Documents")
This example will add all the subdirectories in My Documents folder (in the device) to the ArrayList alDir.
Adds all files matching the search pattern in the specified path to an ArrayList and returns the number of files found.
Syntax: FileSearch (ArrayList, Path [,Search Pattern])
If the Search Pattern is omitted FileSearch will return all the files in the directory.
Search Pattern can include '*' and '?'.
* - Finds zero or more characters.
? - Finds exactly on character.
Example: (alFiles is an ArrayList control)
FileSearch (alFiles, "\My Documents", "*.txt")
This example will add all the files with txt extension in My Documents folder (in the device) to the ArrayList alFiles.
__________________
Paulo Gomes - Porto, Portugal - Living/Working in France
Mobile Device: Samsung Galaxy S, Android 2.3.4 CUstom ROM
Laptop: Toshiba NB100-130 (running on Win7Ultimate)
My Posts helped you? Consider Buying me a Porto Glass!
Cableguy
we know how find files and find folders.but how find files in all subfolders and subsubfolders and sub...subfolders?
__________________
I'll Kill you, I'll Crash you, I'll never be yours!
--------------------------------------------------
Qtek s110; o2 XDA Flame; Nokia E63 red;
ASUS Eee PC 901 (Windows XP sp3) + TouchScreen;
use a bit of logic...
if root folder has subdir, then search each subdir for folders...Until the result is 0Then you will have a series of array with ALL THE SUBFOLDERS OF YOUR MAIN ROOT
Same with the files...
Example:
IF DirSearch(Root(),"\MyDocuments")>0 Then
For x=0 to arraylen(root())-1
Textbox1.text=TextBox1.text&Root(x)&crlf 'this will populate a textbox with the root values
Next
For x=0 to Arraylen(Root())-1
DirSearch(Control(Level(),Root(x))
Textbox1.text=TextBox1.text&Root(x)&crlf
Next
End If
NOTE this is untested code, root and level are arraylist controls...
__________________
Paulo Gomes - Porto, Portugal - Living/Working in France
Mobile Device: Samsung Galaxy S, Android 2.3.4 CUstom ROM
Laptop: Toshiba NB100-130 (running on Win7Ultimate)
My Posts helped you? Consider Buying me a Porto Glass!
Cableguy you read my post?i must find ALL FILES in folder,sub-folders,subsub-folders,subsubsub-folders,subsubsub-folders...subsubsubsubsubsubsubsubsubsubsubsub-folders.
yes,you may use 1000 cicles and create 1000 arraylists...but i want a beautiful way...
p.s. in your code your have some errors)and your cade show only folders from root
__________________
I'll Kill you, I'll Crash you, I'll never be yours!
--------------------------------------------------
Qtek s110; o2 XDA Flame; Nokia E63 red;
ASUS Eee PC 901 (Windows XP sp3) + TouchScreen;
Sub Globals 'Declare the global variables here. End Sub
Sub App_Start Form1.Show FindAllFiles("\My Documents") For i = 0To alFiles.Count-1 listbox1.Add(FileName(alFiles.Item(i))) 'Remove FileName if you need the full Next End Sub
Sub FindAllFiles(root) alFolders.Clear 'ArrayList alFiles.Clear 'ArrayList alFolders.Add(root) i = 0 DoWhile alFolders.Count > i 'search one folder currentFolder = alFolders.Item(i) DirSearch(alFolders,currentFolder) 'Add all subfolders in this folder to the list. FileSearch(alFiles,currentFolder,"*.*") 'Add all files from this folder. b = alFiles.Count i = i + 1 Loop End Sub
Erel big-big-big thanks!!!i'm don't know what dirsearch add folders to arraylist,i'm think it replace)
big thanks!
__________________
I'll Kill you, I'll Crash you, I'll never be yours!
--------------------------------------------------
Qtek s110; o2 XDA Flame; Nokia E63 red;
ASUS Eee PC 901 (Windows XP sp3) + TouchScreen;