Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Copy to usb
Message
 
À
07/04/2005 07:53:35
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Versions des environnements
Visual FoxPro:
VFP 5
Database:
Visual FoxPro
Divers
Thread ID:
01002192
Message ID:
01002214
Vues:
25
>I'm curious about this too. How would you make it generic though. The drive letters could change for a USB device.
>
>>The USB device should have a drive letter assigned to it. Just copy the folder to the drive letter, (IE L:\).

You can use GetDriveType API function. It reports USB drives as removable. I suppose (I HOPE) Windows assign a letter different then "A" or "B" for them (If you have no floppy drive"
? GetUSBDrive() && The function name is not correct, because you can have ZIP drive or other types of removable drives

FUNCTION GetUSBDrive()

   LOCAL nDrives, ret_val, cDrive
   ret_val = ""
   DECLARE INTEGER GetDriveType IN Win32API STRING DriveName
   FOR nDrives = 67 TO 90 && Just not check for "A" or "B" 
	cDrive = CHR(nDrives)+":\"+CHR(0)
        IF GetDriveType(cDrive) = 2 && Removable
           ret_val = ret_val + IIF(EMPTY(ret_val),"",CHR(13)+CHR(10)) + CHR(nDrives)
        ENDIF
    NEXT

RETURN m.ret_val
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform