Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Fetch Serial Number
Message
From
18/10/2003 06:57:51
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
18/10/2003 06:04:21
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00839994
Message ID:
00840000
Views:
19
>Hi all,
>
>Can someone suggest a function (wether VFP or API) through which I can get the serial number of Hard Disk.
>
>I am using version 7.0 of VFP
>
>Thanks in advance

If you mean format assigned serial number :
declare integer GetVolumeInformation ;
	in WIN32API ;
	string @lpRootPathName,	;
    string @lpVolumeNameBuffer,	;
    integer nVolumeNameSize,	;
    integer @lpVolumeSerialNumber,	;
    integer @lpMaximumComponentLength,	;
    integer @lpFileSystemFlags,	;
	string @lpFileSystemNameBuffer,	;
    integer  nFileSystemNameSize

lpRootPathName="d:\"
lpVolumeNameBuffer=space(255)
nVolumeNameSize=255
lpVolumeSerialNumber = 0
lpMaximumComponentLength = 0
lpFileSystemFlags = 0
lpFileSystemNameBuffer = space(1024)
nFileSystemNameSize = 1024

nResult = GetVolumeInformation( ;
	lpRootPathName,	;
	@lpVolumeNameBuffer, ;
	nVolumeNameSize, ;
    @lpVolumeSerialNumber,	;
    @lpMaximumComponentLength,	;
    @lpFileSystemFlags,	;
	@lpFileSystemNameBuffer,	;
    @nFileSystemNameSize)

? 'Serial :',Stuff(Substr(Transform(lpVolumeSerialNumber,'@0'),3),5,0,'-')
? 'Volume :',Left(lpVolumeNameBuffer,At(Chr(0),lpVolumeNameBuffer)-1)
? 'File system :',Left(lpFileSystemNameBuffer,;
    At(Chr(0),lpFileSystemNameBuffer)-1)
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform