Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Determine Available Drives
Message
De
22/10/2003 12:40:01
Nancy Folsom
Pixel Dust Industries
Washington, États-Unis
 
 
À
22/10/2003 11:06:03
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00841069
Message ID:
00841130
Vues:
23
Russell-

>I would like to populate a list with the drive letters of availble disk drives and shared drives. Is there a way to do this?

You have two possibilities, and George has pointed you to a third. For example,
LOCAL lnBuffSize, lcString, lnDrives, lni
lnBuffSize = 200
lcString = SPACE(lnBuffSize)

DECLARE INTEGER GetLogicalDriveStrings IN Win32API AS GetIt;
	INTEGER lnBuffSize, STRING  lcString

= GetIt(lnBuffSize,@lcString)

lnDrives = OCCURS( ":", lcString)

FOR  lni = 1 TO  lnDrives
	THIS.ADDITEM(ADDBS(SUBSTR(lcString, AT(":",lcString,lni )-1,2)))
ENDFOR
I just want to warn you that in any of these cases, if a mapped drive hasn't been connected yet, none of these methods will find them. This is a "gotcha" I ran into when I made a backup routine for a client.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform