Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Serial nos of hard disk
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00265560
Message ID:
00266018
Vues:
27
>>is there any way in vfp to obtain the serial nos of the hard disk.
>
>Yes. Here's a sample
>DECLARE INTEGER GetVolumeInformation IN Win32API;
>  STRING @lpRootPathName,;
>  STRING @lpVolumeNameBuffer,;
>  INTEGER nVolumeNameSize,;
>  INTEGER @lpVolumeSerialNumber,;
>  INTEGER @lpMaximumComponentLength,;
>  INTEGER @lpFileSystemFlags,;
>  STRING @lpFileSystemNameBuffer,;
>  INTEGER nFileSystemNameSize
>STORE SPACE(260) TO lcvolname, lcfilename
>STORE 0 TO lnserialno, lnmaxlen, lnsysflags
>STORE 260 TO lnvolsize, lnfilesize
>lcroot = "C:\"
>lnresult = GetVolumeInformation(@lcroot, @lcvolname, lnvolsize, @lnserialno, @lnmaxlen, lnsysflags, @lcfilename, lnfilesize)
>? lnserialno
>hth,

If you want the result in hexadecimal (as displayed by dir):
If Lnserialno < 0
   Lnserialno = 0xFFFFFFFF + Lnvolsernum + 1
Endif
LcHex = Right(Transform(Lnserialvolsernum, '@0'),8)
? lcHex

Just an opinion... Not a fact.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform