public enum DriveTypes
{
DRIVE_UNKNOWN = 0,
DRIVE_NO_ROOT_DIR = 1,
DRIVE_REMOVABLE = 2,
DRIVE_FIXED = 3,
DRIVE_REMOTE = 4,
DRIVE_CDROM = 5,
DRIVE_RAMDISK = 6
}
Public Enum DriveTypes
DRIVE_UNKNOWN = 0
DRIVE_NO_ROOT_DIR = 1
DRIVE_REMOVABLE = 2
DRIVE_FIXED = 3
DRIVE_REMOTE = 4
DRIVE_CDROM = 5
DRIVE_RAMDISK = 6
End Enum
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim allDrivesDriveInfo As System.Collections.ObjectModel.ReadOnlyCollection(Of System.IO.DriveInfo)
allDrivesDriveInfo = My.Computer.FileSystem.Drives
'Another way to get the Drives is:>>
Dim myDrives() As System.IO.DriveInfo = System.IO.DriveInfo.GetDrives
For Each d As System.IO.DriveInfo In myDrives
Select Case d.DriveType
Case System.IO.DriveType.Unknown
'Your code here.>>
Case System.IO.DriveType.NoRootDirectory
'Your code here.>>
Case System.IO.DriveType.Removable
'Your code here.>>
Case System.IO.DriveType.Fixed
'Your code here.>>
Case System.IO.DriveType.Network
'Your code here.>>
Case System.IO.DriveType.CDRom
'Your code here.>>
Case System.IO.DriveType.Ram
'Your code here.>>
End Select
Next
End Sub
End Class
None.