This is slightly modified from the VB 2005 .NET help files. lstInfo is a listbox in my test application.
Dim alldrives() As DriveInfo = DriveInfo.GetDrives()
Dim d As DriveInfo
For Each d In alldrives
lstInfo.Items.Add(String.Format( _
"Drive {0}", d.Name))
lstInfo.Items.Add(String.Format( _
" File type: {0}", d.DriveType))
If d.IsReady = True Then
lstInfo.Items.Add(String.Format( _
" Volume label: {0}", d.VolumeLabel))
lstInfo.Items.Add(String.Format( _
" File system: {0}", d.DriveFormat))
lstInfo.Items.Add(String.Format( _
" Available space to current user:{0, 12:N0} Mbytes", _
d.AvailableFreeSpace >> 20))
lstInfo.Items.Add(String.Format( _
" Total available space: {0, 12:N0} Mbytes", _
d.TotalFreeSpace >> 20))
lstInfo.Items.Add(String.Format( _
" Total size of drive: {0, 12:N0} Mbytes ", _
d.TotalSize >> 20))
End If
Next