Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
 
 
 
500MB 27GB Web Hosting - $9.95/Month
 
 
 
 
 
Old Pages
 
Old Index
Site Map
What's New
 
Books
How To
Tips & Tricks
Tutorials
Stories
Performance
Essays
Links
Q & A
New in VB6
Free Stuff
Pictures
 
 
 
TitleList the system's disk drives in VB .NET using GetLogicalDrives
Keywordsdisk, drive, list
CategoriesTips and Tricks
 
Use System.IO.Directory.GetLogicalDrives() to get an array of strings listing the drives. This example loops through the array adding the drives to a ListBox.
 
Private Sub Form1_Load(ByVal sender As System.Object, ByVal _
    e As System.EventArgs) Handles MyBase.Load
    Dim dirs() As String = _
        System.IO.Directory.GetLogicalDrives()
    Dim i As Long

    For i = dirs.GetLowerBound(0) To dirs.GetUpperBound(0)
        lstDrives.Items.Add(dirs(i))
    Next i
End Sub
 
 
Copyright © 1997-2003 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated