Это полный модуль для VB.NET:
Импортирует System.IO
Модуль GetDriveNamesByType
Функция GetDriveNames (необязательно, ByVal DType As DriveType = DriveType.Removable) As ListBox
Для каждого DN как System.IO.DriveInfo в My.Computer.FileSystem.Drives
Если DN.DriveType = DType Тогда
GetDriveNames.Items.Add (DN.Name)
Конец, если
Далее
Конечная функция
Конечный модуль
'Drive Types <br>
'Unknown: The type of drive is unknown. <br>
'NoRootDirectory: The drive does not have a root directory. <br>
'Removable: The drive is a removable storage device, such as a floppy disk drive or a USB flash drive. <br>
'Fixed: The drive is a fixed disk. <br>
'Network: The drive is a network drive. <br>
'CDRom: The drive is an optical disc device, such as a CD or DVD-ROM. <br>
'Ram: The drive is a RAM disk. <br>