Posted By

mafro on 04/23/07


Tagged

tree recursion


Versions (?)

Recursion


 / Published in: VB.NET
 

Simple directory recursion

  1. Private Sub RecurseDir(ByVal path As String)
  2. Dim s As String
  3.  
  4. 'recurse down thru each folder
  5. For Each s In IO.Directory.GetDirectories(path)
  6. RecurseDir(s)
  7. Next
  8.  
  9. 'then print files
  10. For Each s In IO.Directory.GetFiles(path)
  11. Console.WriteLine(s)
  12. Next
  13. End Sub

Report this snippet  

You need to login to post a comment.