Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
HDD Serial number
Message
 
À
11/08/1998 07:36:03
Jovo Mirkovic
Institute For Students' Health of Bg Uni
Belgrade, Serbia
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00125520
Message ID:
00125526
Vues:
11
>How i can get HDD serial number from VFP 5.0?

Hi Jovo,

Use the following API call:
DECLARE SHORT GetVolumeInformation IN Win32API;
  STRING @lpRootPathName, STRING @lpVolumeNameBuffer,;
  INTEGER nVolumeNameSize, INTEGER @lpVolumeSerialNumber,;
  INTEGER @lpMaximumComponentLength, INTEGER @lpFileSystemFlags,;
  STRING @lpFileSystemNameBuffer, INTEGER nFileSystemNameSize
lcroot = "C:\"
STORE 0 TO lnserialno, lncomplen, lnsysflags
STORE SPACE(260) TO lcvolname, lcsysname
STORE LEN(lcvolname) TO lnvolsize, lnnamesize
llresult = (GetVolumeInformation(@lcroot, @lcvolname,;
  lnvolsize, @lnserialno, @lncomplen, @lnsysflags,;
  @lcsysname, lnnamesize) # 0)
The lnserialno variable will contain the serial number.

BTW, what's displayed by DOS is the hexadecimal representation of this number.

hth,
George

Ubi caritas et amor, deus ibi est
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform