Private Declare Function GetDriveType Lib "kernel32.dll" Alias "GetDriveTypeA" _ (ByVal nDrive As String) As Long
'GetDriveType Constants
Const DRIVE_REMOVABLE = 2
Const DRIVE_FIXED = 3
Const DRIVE_REMOTE = 4
Const DRIVE_CDROM = 5
Const DRIVE_RAMDISK = 6
Private Sub cGetDriveType()
Dim i, Drv, D$
For i = 0 To 25
D$ = Chr$(i + 65) & ":\"
Drv = GetDriveType(D$)
Select Case Drv
Case DRIVE_REMOVABLE
MsgBox "Диск " & D$ & "сменный диск.", vbOKOnly + vbInformation
Case DRIVE_FIXED
MsgBox "Диск " & D$ & "жесткий диск.", vbOKOnly + vbInformation
Case DRIVE_REMOTE
MsgBox "Диск " & D$ & "сетевой диск.", vbOKOnly + vbInformation
Case DRIVE_CDROM
MsgBox "Диск " & D$ & "CD-ROM.", vbOKOnly + vbInformation
Case DRIVE_RAMDISK
MsgBox "Диск " & D$ & "is RAM disk.", vbOKOnly + vbInformation
Case Else
End Select
Next i
End Sub |
|