Einzelnen Beitrag anzeigen

taktaky
(Gast)

n/a Beiträge
 
#1

CPU-ID Format / die 0 soll unterdrücken

  Alt 24. Aug 2007, 16:19
Hallo

diese Funktion zeigt eine ID aber das kann nicht eine CPUID oder Hardware ID, da ich
diese unter 2 PCs getestet habe. Ich bekomme immer die selbe ID !!! das kann nicht sein

Wer kann mir einen anderen Code geben?

Delphi-Quellcode:
uses
   HELLAPI, ...;

Delphi-Quellcode:
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;

procedure TForm1.Button1Click(Sender: TObject);
var
Fdrive: string;
result:String;
Serial: DWord;
DirLen, Flags: DWord;
DLabel : Array[0..11] of Char;
begin
Try
//getvolumeinformation(Pchar(Fdrive+':\'),dlabel,12,@serial,dirlen,flags,nil,0);
GetVolumeInformation(PChar(FDrive+':\'),dLabel,12,@Serial,DirLen,Flags,nil,0);
Result := IntToHex(Serial,8);
Form1.Caption:=Result;
InputBox('Serial: ','Hardware-ID',Result)
//http://www.forumweb.com.br/foruns/index.php?act=Print&client=printer&f=146&t=63127
Except
Result := '';
end;
end;

procedure TForm1.Button2Click(Sender: TObject);
var
Fdrive: string;
result:String;
Serial: DWord;
DirLen, Flags: DWord;
DLabel : Array[0..11] of Char;
begin
Try
//getvolumeinformation(Pchar(Fdrive+':\'),dlabel,12,@serial,dirlen,flags,nil,0);
GetVolumeInformation(PChar(FDrive+':\'),dLabel,12,@Serial,DirLen,Flags,nil,0);
Result := IntToHex(Serial,8);
Form1.Caption:=Result;
InputBox('Serial: ','Hardware-ID',Result)
//http://www.forumweb.com.br/foruns/index.php?act=Print&client=printer&f=146&t=63127
Except
Result := '';
end;
end;
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;

procedure TForm1.Button1Click(Sender: TObject);
var
Fdrive: string;
result:String;
Serial: DWord;
DirLen, Flags: DWord;
DLabel : Array[0..11] of Char;
begin
Try
//getvolumeinformation(Pchar(Fdrive+':\'),dlabel,12,@serial,dirlen,flags,nil,0);
GetVolumeInformation(PChar(FDrive+':\'),dLabel,12,@Serial,DirLen,Flags,nil,0);
Result := IntToHex(Serial,8);
Form1.Caption:=Result;
InputBox('Serial: ','Hardware-ID',Result)
//http://www.forumweb.com.br/foruns/index.php?act=Print&client=printer&f=146&t=63127
Except
Result := '';
end;
end;

procedure TForm1.Button2Click(Sender: TObject);
var
Fdrive: string;
result:String;
Serial: DWord;
DirLen, Flags: DWord;
DLabel : Array[0..11] of Char;
begin
Try
//getvolumeinformation(Pchar(Fdrive+':\'),dlabel,12,@serial,dirlen,flags,nil,0);
GetVolumeInformation(PChar(FDrive+':\'),dLabel,12,@Serial,DirLen,Flags,nil,0);
Result := IntToHex(Serial,8);
Form1.Caption:=Result;
InputBox('Serial: ','Hardware-ID',Result)
//http://www.forumweb.com.br/foruns/index.php?act=Print&client=printer&f=146&t=63127
Except
Result := '';
end;
end;
Gruß
  Mit Zitat antworten Zitat