We Recommend

Beginning VB.NET Beginning VB.NET
Visual Basic .NET is the latest version of the most widely used programming language in the world, popular with professional developers and complete beginners alike. This book will teach you Visual Basic .NET from first principles. You'll quickly and easily learn how to write Visual Basic .NET code and create attractive windows and forms for the users of your applications.


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.