Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
C# Helper...
 
XML RSS Feed
Follow VBHelper on Twitter
 
 
 
MSDN Visual Basic Community
 
 
 
 
 
TitleList the computer's logical drives in VB.NET
DescriptionThis 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.
Keywordsdrive, drives, list drives, logical drives, VB.NET
CategoriesWindows
 
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
 
 
Copyright © 1997-2010 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated