|
|
Title | List the computer's logical drives in VB.NET |
Description | This example shows how to list the computer's logical drives in VB.NET. It uses the Directory.GetLogicalDrives method to get an array of the drive names. |
Keywords | drive, drives, list drives, logical drives, VB.NET |
Categories | Windows |
|
|
When it starts, the program uses the Directory.GetLogicalDrives method to get an array of the drive names and displays them in a ListBox.
|
|
' List the drives.
Private Sub Form1_Load(ByVal sender As System.Object, ByVal _
e As System.EventArgs) Handles MyBase.Load
For Each drive As String In Directory.GetLogicalDrives()
lstDrives.Items.Add(drive)
Next drive
End Sub
|
|
|
|
|
|