Fórum serial do hd #172403
30/07/2003
0
alguém saberia me dizer como pegar o número serial do hd, me passaram uma rotina mas a cada vez que puxo o número, vem um valor diferente.
quero usar o serial para forçar o meu programa rodar somente neste computador.
alguém pode me ajudar
quero usar o serial para forçar o meu programa rodar somente neste computador.
alguém pode me ajudar
Salupe
Curtir tópico
+ 0
Responder
Posts
30/07/2003
Wtjunior
Aí vai a rotina
uses Windows;
function SerialHD(): string;
function SerialHD(): string;
var
SLabel, SSysName: PChar;
Serial1: string;
Serial, FileNameLen, X: DWord;
begin
GetMem(SLabel, 255);
GetMem(SSysName, 255);
try
GetVolumeInformation(´C:\´, SLabel, 255, @Serial, FileNameLen, X, SSysName, 255);
Serial1 := IntToHex(Serial, 8);
finally
FreeMem(SLAbel, 255);
FreeMem(SSysName, 255);
end;
result := Serial1;
end;
uses Windows;
function SerialHD(): string;
function SerialHD(): string;
var
SLabel, SSysName: PChar;
Serial1: string;
Serial, FileNameLen, X: DWord;
begin
GetMem(SLabel, 255);
GetMem(SSysName, 255);
try
GetVolumeInformation(´C:\´, SLabel, 255, @Serial, FileNameLen, X, SSysName, 255);
Serial1 := IntToHex(Serial, 8);
finally
FreeMem(SLAbel, 255);
FreeMem(SSysName, 255);
end;
result := Serial1;
end;
Responder
Gostei + 0
30/07/2003
Wtjunior
Correção
No lugar da carinha é 8) (oito e parênteses)
No lugar da carinha é 8) (oito e parênteses)
Responder
Gostei + 0
Clique aqui para fazer login e interagir na Comunidade :)