Buscar

Como visualizar arquivos arj?

Código

Function ConverterAtributos (A: Integer): String;
begin
Result:= '---W';
if A and faArchive <> 0 then
Result[1]:= 'A';
if A and faSysFile <> 0 then
Result[2]:= 'S';
if A and faHidden <> 0 then
Result[3]:= 'H';
if A and faReadOnly <> 0 then
Result[4]:= 'R';
end;
procedure TFormPrincipal.BotaoAbrirClick (Sender: TObject);
var
P : Integer;
Info: TInfoArj;
Arj : TArj;
begin
if OpenDialog.Execute then begin
Caption:= OpenDialog.FileName;
Arj := TArj.Create;
Arj.LoadFromFile (OpenDialog.FileName);
Lista.Items.Clear;
Lista.Items.BeginUpdate;
for P:= 0 to Arj.Lista.Count-1 do begin
Info:= Arj.Buscar (P);
with Lista.Items.Add do begin
Caption:= Arj.Lista.Strings[P];
SubItems.Add (IntToStr (Info.Descompactado));
SubItems.Add (IntToStr (Info.Compactado));
SubItems.Add (DateTimeToStr (Info.Modificado));
SubItems.Add (ConverterAtributos (Info.Attributos));
SubItems.Add (IntToHex (Info.CRC, 8));
end;
end;
Lista.Items.EndUpdate;
Arj.Free;
end;
end;

Publicidade

Vote na dica




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


Detalhes da dica

Categoria: Arquivos
Adicionada dia: 06/06/03
Por: Felipe Monteiro
Visualizada: 2043 vezes

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