Get Directory contents : Directory « Stream File « VB.Net Tutorial






Imports System.IO

Public Class Tester
    Public Shared Sub Main
    
         If Directory.Exists("c:\\") Then

            Dim directoryList As String() ' array for directories
            Dim i As Integer

            directoryList = Directory.GetDirectories("c:\\")

            For i = 0 To directoryList.Length - 1
               Console.WriteLine(directoryList(i))
            Next
         End If
    End Sub

End Class
c:\\Documents and Settings
c:\\Java_Dev
c:\\oracle
c:\\Program Files
c:\\RECYCLER
c:\\System Volume Information
c:\\SYSTEM.SAV
c:\\Temp
c:\\WINDOWS








13.12.Directory
13.12.1.Create a directory
13.12.2.Get CurrentDirectory
13.12.3.Get Directory contents
13.12.4.Get Directory Creation Time
13.12.5.Use the GetFiles method to return file names from a user-specified location.