How to list the directory of the C:\ drive of your computer
I am using System.IO.Directory.GetDirectories()
get the list files under C:\ drive. This method will return the array of string
So I can loop through the array of string using For… Each
For Each strName As String In System.IO.Directory.GetDirectories("C:\") Console.WriteLine(strName) Next
Output in console
C:\data
C:\Documents and Settings
C:\PerfLogs
C:\Program Files
C:\Program Files (x86)
C:\ProgramData
C:\Recovery
C:\System Volume Information
C:\Users
C:\Windows