Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do you protect your application?
Message
De
30/04/2001 07:44:57
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00501266
Message ID:
00501447
Vues:
15
Use the GetVolumeInformation API Call:

* GetVolumeInformation() returns volume names, ;
* serial numbers, file systems, and other stuff.

DECLARE short GetVolumeInformation IN Win32API ;
STRING lpRootPathName, ;
STRING lpVolumeNameBuffer, ;
INTEGER nVolumeNameSize, ;
STRING lpVolumeSerialNumber, ;
STRING lpMaximumComponentLength, ;
STRING lpFileSystemFlags, ;
STRING lpFileSystemNameBuffer, ;
INTEGER nFileSystemNameSize

* Skip trying to obtain the name or drive type of
* floppies: this can bring up an untrappable error

* Obtain the Volume Name etc.
STORE SPACE(255) TO lpRootPathName, ;
lpVolumeNameBuffer, ;
lpVolumeSerialNumber, ;
lpMaximumComponentLength, ;
lpFileSystemFlags, ;
lpFileSystemNameBuffer

STORE 255 TO nVolumeNameSize, ;
nFileSystemNameSize

= GetVolumeInformation(lcDrive, ;
@lpVolumeNameBuffer, ;
@nVolumeNameSize, ;
@lpVolumeSerialNumber, ;
@lpMaximumComponentLength, ;
@lpFileSystemFlags, ;
@lpFileSystemNameBuffer, ;
@nFileSystemNameSize )

* Truncate the buffer to the CHR(0) end of string
* or to zero for blank volumes
lpVolumeNameBuffer = LEFT(lpVolumeNameBuffer, ;
AT(CHR(0),lpVolumeNameBuffer)-1)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform