Site hosted by Angelfire.com: Build your free website today!
undefined
undefined

CODICE COMPATTO
Poche accurate linee di codice...

Sommario:

Determina la lettera del cd-rom (e non solo)

Determina la lettera del cd-rom (e non solo)

Attraverso la funzione API GetDriveType è possibile ottenere le caratteristiche delle unità connesse al proprio PC: è possibile conoscere se l'unità mappata è un unita di rete, la funzione restituisce i seguenti valori:

Valore Significato
DRIVE_UNKNOWN unità sconosciuta
DRIVE_NO_ROOT_DIR root dell'unità inesistente
DRIVE_REMOVABLE unità con disco rimovibile
DRIVE_FIXED unità disco fisso.
DRIVE_REMOTE unità di rete.
DRIVE_CDROM unità CD-ROM drive.
DRIVE_RAMDISK unità RAM disk.

Il seguente codice VB consente l'individuazione di un unità CD-ROM

Private Declare Function GetDriveType Lib "kernel32" Alias "GetDriveTypeA" (ByVal nDrive As String) As Long

Function FindCDROM() As String
Dim Drive As Integer
Const DRIVE_REMOTE = 4
Const DRIVE_CDROM = 5


FindCDROM = "No CD_ROM Installed"
For Drive = 65 To 90
If GetDriveType(Chr(Drive) & ":\") = DRIVE_CDROM Then
FindCDROM = "CD-ROM Drive " & Chr(Drive) & ":\"
End
If
If GetDriveType(Chr(Drive) & ":\") = DRIVE_REMOTE Then
FindCDROM = FindCDROM + Chr$(13) + Chr$(10) + "Network Drive " & Chr(Drive) & ":\"
Exit For
End If
Next
Drive


Msgbox (FindCDROM)
End Function

Determinare la risoluzione del video

fsdfd