Re: File Compression

Posted by Jenny on April 04, 2005

In Reply to: File Compression posted by Tomas

: Hi, can someone help me with some example using file compression in Delphi?
: I have a TXT file as input and I want to create a "ZIPPED" file as output.
: Can you write this procedure? I'm begginer in Delphi programming.

Much too complicated... better use a ZIP-component, or use external application:

procedure TForm1.Button1Click(Sender: TObject);
const
  Zipper = 'c:\program files\winzip\winzip32.exe';
var
  Source, Destination, Params: string;
begin
  Source := 'c:\test1\*.*';
  Destination := 'c:\test2\test1.zip';
  Params := '-a ' + Destination + ' ' + Source;
  ShellExecute(Handle, 'Open', PChar(Zipper), PChar(Params), nil, SW_NORMAL);
end;

Related Articles and Replies


 


Delphi Forum :: Tutorials :: Source code :: Tips