Traversing all subdirectories and all files in those subdirectories

Hello all,

I know in .NET 2.0 there's a flag that you can set for your .GetDirectories(somePath) method, but in .NET 1.1, is there a clean way of traversing all subdirectories without using whiles, and for each's and what not

Props to the hardcore programmers going at it on a Sat night haha

Thanks.

N. Farr



Answer this question

Traversing all subdirectories and all files in those subdirectories

  • Mario Rodriguez

    u can do it by making recursive calls
  • capriono

    That's what I ended up doing, it doesn't seem that 1.1 has a function that would one-line it for you.

    Cheers all.

    NRF


  • Ensoft

    in 1.1 your best bet is using system.io.directory class and then utilizing the getfiles and get directory methods....

  • Traversing all subdirectories and all files in those subdirectories