Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to get number of drives on machine & their types in
Message
 
À
09/07/2004 12:47:29
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00922574
Message ID:
00922588
Vues:
13
>how to get number of drives on machine & their types in VFP6

Rajesh,

There are a couple of ways. First, check out the DRIVETYPE() function. Then you could use the GetLogicalDrives() or GetLogicalDriveStrings() API call.
DECLARE INTEGER GetLogicalDrives IN Win32API
lndrives = GetLogicalDrives()
? BITTEST(lndrives, 0)
You can simply iterate through the bits using BITTEST() and any time it returns .T. add 65 to the bit value (0-25).

Next there's the Windows Script Host's Drives object.
oFSO = CREATEOBJECT('Scripting.FileSystemObject')
oDrives = oFSO.Drives
FOR EACH oDrive IN oDrives
  ? oDrive.DriveLetter 
NEXT
George

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

Click here to load this message in the networking platform