Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ERASE command help????
Message
De
10/10/2001 11:04:21
 
 
À
10/10/2001 10:40:29
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00566424
Message ID:
00566436
Vues:
10
Paul, Do you know what drive it is on? If not, and you need to determine what drives are available to locate the file to be deleted, the following code might help get you started--it checks to see what drives are available:

*!* BEGIN CODE SAMPLE Unremark the next line if necessary
*!* SET LIBRARY TO \VFP\FOXTOOLS.FLL & Register the FOXTOOLS Library
DECLARE INTEGER WNetGetConnection IN win32api ;
STRING lpszLocalName,;
STRING lpszRemoteName,;
INTEGER @ lpchBuffer && Declare the external WNetGetConnection ;
API function
slpRemoteName = SPACE(254) && Initialize variables
slen = LEN(slpRemoteName) && Initialize variables
FOR I = 1 to 26 && step through all drives A-Z
DRIVE = CHR(I + 64)
DTYPE = DRIVETYPE(drive) && Determine drive type
DO CASE
CASE DTYPE = 0 && Drive does not exist
? "Drive " + DRIVE + ": does not exist"
CASE DTYPE = 1 && No root directory
? "Drive " + DRIVE + ": has no root directory"
CASE DTYPE = 2 && Floppy drives
? "Drive " + DRIVE + ": is a floppy drive"
CASE DTYPE = 3 && Hard drives
? "Drive " + DRIVE + ": is a local hard drive"
CASE dtype = 4 && Removable or network drives
iSuccess = WNetGetConnection(drive + ;
":",@slpRemoteName,@slen)
IF iSuccess = 0
? "Drive " + Drive + ": is a network" + ;
" drive and is connected to " + LEFT(slpRemoteName,;
ATC(chr(0),slpRemoteName) - 1)
ENDIF
CASE DTYPE = 5 && CD-ROM devices
? "Drive " + DRIVE + ": is a CD ROM drive"
CASE DTYPE = 6 && RAM drives
? "Drive " + DRIVE + ": is a RAM drive"
ENDCASE
ENDFOR
*!* END OF CODE SAMPLE
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform