Imports System.IO
Module Module1
Sub DisplayTree(ByVal Dir As String)
Dim Files As String() = Directory.GetFiles(Dir)
Dim Dirs As String() = Directory.GetDirectories(Dir)
Dim Filename As String
For Each Filename In Files
Console.WriteLine(Filename)
Next
Dim DirectoryName As String
For Each DirectoryName In Dirs
DisplayTree(DirectoryName)
Next
End Sub
Sub Main()
DisplayTree("C:\")
End Sub
End Module
|