Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function GetHardDiskSerial(const DriveLetter: Char): string;
- var
- NotUsed: DWORD;
- VolumeFlags: DWORD;
- VolumeInfo: array[0..MAX_PATH] of Char;
- VolumeSerialNumber: DWORD;
- begin
- GetVolumeInformation(PChar(DriveLetter + ':\'),
- nil, SizeOf(VolumeInfo), @VolumeSerialNumber, NotUsed,
- VolumeFlags, nil, 0);
- Result := Format('%s%8.8X',
- [VolumeInfo, VolumeSerialNumber])
- end;
- procedure TForm1.Button9Click(Sender: TObject);
- begin
- Edit1.Text:=GetHardDiskSerial('c');
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement