Recursion?

vnarod

Regular
Joined
Mar 22, 2002
Messages
84
I need to access all files in a given directory and all subdirectories. So I write a sub with Dir that is calling itself with recursion. The problem is that inside calls to Dir screw outside calls Dir, so that when I go back in recusion my Dir is reset.
How should I approach this task?
 
Don't use Dir. :)

Use System.IO.Directory.GetFiles() to retrieve a list of all the files in a directory and .GetDirectories() to get the directories.
 
Back
Top