Ver Mensaje Individual
  #2  
Antiguo 05-03-2008
Avatar de Caral
[Caral] Caral is offline
Miembro Premium
 
Registrado: ago 2006
Posts: 7.659
Reputación: 25
Caral Va por buen camino
Hola
Código Delphi [-]

function GetVolumeID(DriveChar: Char): String;
var
MaxFileNameLength, VolFlags, SerNum: DWord;
 Begin
 if GetVolumeInformation(PChar(DriveChar + ':\'), nil, 0,
 @SerNum, MaxFileNameLength, VolFlags, nil, 0)
 then
 begin
 Result := IntToHex(SerNum,8);
 Insert('-', Result, 5);
 end
 else
 Result := '';
 end;

procedure TForm1.FormCreate(Sender: TObject);
begin
   Edit1.Text:=GetVolumeId('c');
end;
Saludos
Responder Con Cita