4

Do C# support zipping multiple files without using free third-party solutions. I knew there are some third-party solutions such as DotNet zip, SharpZipLib etc... did this, but I would like to create a one without using any of the above.

I see using J# (vjslib.dll) we can use GZip but J# is currently retired and not included in VS2010.

Can you point me to the correct place of this implementation?

John Saunders
  • 160,644
  • 26
  • 247
  • 397
ary
  • 597
  • 3
  • 8
  • 20

2 Answers2

9

There is always System.IO.Compression which features a class called GZipStream. The ability to write real *.zip files will only be added in .NET 4.5 (see System.IO.Compression in 4.5).

So for now you can either try to write your own implementation (not recommended) or use a third-party component. Depending on the license of the component, you might be able to copy its code into your project (making patches to the component a bit cumbersome). The GPL for instance only requires you to release your source code when you distribute your derivative work. But in the case of a web application where no code or binary is actually given away, there are no consequences to using a GPL-ed library.

svick
  • 236,525
  • 50
  • 385
  • 514
Christian Klauser
  • 4,416
  • 3
  • 31
  • 42
4

If at any point your mind changes and you want free third party option i guess this the the best you can get.

http://dotnetzip.codeplex.com/

Nikhil Agrawal
  • 47,018
  • 22
  • 121
  • 208
  • +1 DotNetZip - makes things real simple. If you want to tinker for some reason, you have source. – EdSF May 11 '12 at 04:29
  • DotNetZip is nice of course. But the question was zipping files **without using free third-party solutions** – sampathsris Jun 22 '15 at 11:09