Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Drive letter
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Divers
Thread ID:
00229198
Message ID:
00229242
Vues:
13
>How do I know if a Drive Letter exist.

Hi Plinio,

To add to what John and Vlad have said, you can also access the Windows API, by calling either GetLogicalDrives() or GetLogicalDriveStrings(). I prefer using the former like this:
DECLARE INTEGER GetLogicalDrives IN Win32API
lndrives = GetLogicalDrives()
* If a bit is set the drive exists
* Test if F: exists
llresult = BITTEST(lndrives, 5)
The bits (0-25) represent whether or not a drive is mapped to that letter. Bit 0 is A:, bit 1 is B:, etc.
George

Ubi caritas et amor, deus ibi est
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform