Serial Físico do hd
olá, pessoal alguém conhece uma função que retorne o serial físico do hd? grato.
Marcos Morais
Curtidas 0
Respostas
Luiz Eduardo
29/11/2013
Maneira mais fácil é usando a WMI.
GOSTEI 0
Gustavo Bretas
29/11/2013
Segue:
function SerialNum(FDrive: String): String;
Var
Serial: DWord;
DirLen, Flags: DWord;
DLabel: Array [0 .. 11] of Char;
begin
Try
GetVolumeInformation(PChar(FDrive + ':\'), DLabel, 12, @Serial, DirLen, Flags, nil, 0);
Result := IntToHex(Serial, 8);
Except
Result := '';
end;
end;GOSTEI 0