Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Determine Available Drives
Message
 
 
À
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:
00841080
Vues:
28
>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?
>
>Thanks in advance for you help,
>Russell

You can also use DRYVETYPE() function
DIMENSION laDrives[1,2]
lnDriveCount = 0
FOR i=ASC("A") TO ASC("Z")
	lnDriveType = DRIVETYPE(CHR(i))
	DO CASE
	CASE lnDriveType = 2
		lcDriveType = "Floppy"
	CASE lnDriveType = 3
		lcDriveType = "Local HD"
	CASE lnDriveType = 4
		lcDriveType = "Removable/Network"
	CASE lnDriveType = 5
		lcDriveType = "CD-ROM"
	OTHERWISE	
		lcDriveType = ""
	ENDCASE	
	IF NOT EMPTY(lcDriveType)
		lnDriveCount = lnDriveCount + 1
		DIMENSION laDrives[lnDriveCount,2]
		laDrives[lnDriveCount,1] = CHR(i)
		laDrives[lnDriveCount,2] = lcDriveType 
	ENDIF
ENDFOR
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform