Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Volume serial number
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00365631
Message ID:
00365985
Vues:
11
Michael,

Code below will do what you want. Thing is, it does not work with Network drives.

FUNCTION GetDiskSerialNo

DECLARE INTEGER GetVolumeInformation IN WIN32API;
STRING lpRootPathName,;
STRING @lpVolumeNameBuffer,;
INTEGER nVolumeNameSize,;
INTEGER @lpVolumeSerialNumber,;
INTEGER @lpMaximumComponentLength,;
INTEGER @lpFileSystemFlags,;
STRING @lpFileSystemNameBuffer,;
INTEGER nFileSystemNameSize

LOCAL lnNumber, lcNumber

lnNumber = 0

GetVolumeInformation( "C:\",.NULL.,0,@lnNumber,0,0,.NULL.,0 )

lcNumber = SUBSTR(TRANSFORM(m.lnNumber,"@0"),3)

cSerialNo = LEFT(m.lcnumber,4)+RIGHT(m.lcnumber,4)
RETURN cSerialNo

JB

>>How can I get the volume serial number for my hard drive through VFP like I do when I type 'LABEL' in DOS? Thanks for any help
>
>Michael,
>
>You need an API call for this. There is one file here in the libs (author Paul Vlad Tatavu) that does just that.
>
>José
JESS S. BANAGA
Project Leader - SDD division
...shifting from VFP to C#.Net

CHARISMA simply means: "Be more concerned about making others feel good about themselves than you are in making them feel good about you."
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform