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;