Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Serial nos of hard disk
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00265560
Message ID:
00266018
Views:
28
>>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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform