Scalabium Software

SMExport/SMImport suites
Knowledge for your independence'.
Home Delphi and C++Builder tips


#55: How can I get the serial number of a disk?

If you need retrieve the serial number of a disk, you can call the GetVolumeInformation function from Windows API. View example:

var
  VolumeSerialNumber: DWORD;
  MaximumComponentLength: DWORD;
  FileSystemFlags: DWORD;
  SerialNumber: string;
begin
  GetVolumeInformation('C:\',
                       nil,
                       0,
                       @VolumeSerialNumber,
                       MaximumComponentLength,
                       FileSystemFlags,
                       nil,
                       0);
  SerialNumber := IntToHex(HiWord(VolumeSerialNumber), 4) +
                  '-' +
                  IntToHex(LoWord(VolumeSerialNumber), 4);
end;


Published: December 28, 1999

See also
 
Protected Storage Viewer
SMDBGrid
Word Web-stream
Paradox to MS Access converter
Excel Reader (dll)
DBISAM Viewer
ExcelFile Viewer
Excel Web-stream
DBExport tools
Mail parser (ActiveX)
 
 


Contact to webmaster

 

Borland Software Code Gear Scalabium Delphi tips

Copyright© 1998-2018, Scalabium Software. All rights reserved.
webmaster@scalabium.com

SMReport Autogenerated