How can I use a for loop to loop the file in a directory?
Printable View
How can I use a for loop to loop the file in a directory?
could you please explain in detail what the heck that meant. I am sure i can help but i don't understand the question. Give an example if possible.
Are you talking about recursion?
If you are talking about Filling an array with filenames, loops aren't necessary for that in vb.net.
Code:' Create an array representing the files in the current directory.
Dim fi As System.IO.FileInfo() = di.GetFiles()
Dim fiTemp As System.IO.FileInfo
For Each fiTemp In fi
msgbox fiTemp.Name
Next fiTemp