Drives - numero de serie

Top  Previous  Next

function ExtractDiskSerial(const Drive: char): string;

var

  Serial       : DWord;

  DirLen, Flags: DWord;

  DLabel       : array[0..11of Char;

begin

  GetVolumeInformation(PChar( Drive + ':\' ), dLabel, 12, @Serial, DirLen, Flags, nil, 0);

  Result := IntToHex(Serial,8);

end;