vnarod Posted July 25, 2003 Posted July 25, 2003 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? Quote
*Experts* Volte Posted July 25, 2003 *Experts* Posted July 25, 2003 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. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.