On Sep 30, 3:56*am, Robert Scheer <rbsch...@my-deja.com> wrote:
> Hi.
>
> I am reading about the compression classes from the .Net Framework but
> have some doubts. Maybe you can help me.
>
> What is the difference between compressing a stream and compressing a
> file, if any?
> The purpose of these compression classes is to work compression like
> an Winarj or Winzip application does?
>
> Regards,
> Robert Scheer
I suggest Ionic zip library. Many features, included those missing
in .net implementation, Open source, free and very easy to use.
http://dotnetzip.codeplex.com/
Here is how to create a zip file from files in hard disc:
using (ZipFile zip = new ZipFile())
{
// add this map file into the "images" directory in the zip
archive
zip.AddFile("c:\\images\\personal\\7440-N49th.png", "images");
// add the report into a different directory in the archive
zip.AddFile("c:\\Reports\\2008-Regional-Sales-Report.pdf",
"files");
zip.AddFile("ReadMe.txt");
zip.Save("MyZipFile.zip");
}
Best regards.