Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
HDD Serial number
Message
 
To
11/08/1998 07:36:03
Jovo Mirkovic
Institute For Students' Health of Bg Uni
Belgrade, Serbia
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00125520
Message ID:
00125526
Views:
10
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform