Buscar

Visualizando arquivos compactados cab

Código

Procedure TFormPrincipal.BotaoAbrirClick (Sender: TObject);
var
K : Integer;
N : Integer;
Info: pInfoCabinet;
Nome: String;
Path: String;
begin
SetCurrentDir ('D:TempCab');
if OpenDialog.Execute then begin
N := 0;
Cabinet:= TCabinet.Create;
Cabinet.LoadFromFile (OpenDialog.FileName);
Lista.Items.BeginUpdate;
Lista.Items.Clear;
Lista.ViewStyle:= vsReport;
for K:= 0 to Cabinet.Lista.Count-1 do begin
Nome:= Cabinet.ExtrairNomePath (Cabinet.Lista.Strings[K], Path);
if Nome <> '' then
with Lista.Items.Add do begin
Inc (N);
Caption:= Nome;
Info := pInfoCabinet (Cabinet.Lista.Objects[K]);
if Info <> nil then
with Info^ do begin
SubItems.Add (IntToStr (Descompactado));
SubItems.Add (DateTimeToStr (Modificado));
SubItems.Add (Path);
end;
end;
end;
Lista.Items.EndUpdate;
Caption:= OpenDialog.FileName + ' - ' + IntToStr (N) + ' arquivo(s)';
Cabinet.Free;
end;
end;

Publicidade

Vote na dica




Quantidade de votos: 0 votos
Aceitação: 0%


Detalhes da dica

Categoria: Object pascal
Adicionada dia: 24/06/03
Por: Felipe Monteiro
Visualizada: 1376 vezes

Planeta Delphi - Tudo sobre programação Delphi Planeta Delphi - www.planetadelphi.com.br - Todos os direitos reservados | Copyright 2001-2009