Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the best/easiest way to create ZIP archive in .NET?

Tags:

c#

.net

zip

Which method do you think is the "best".

  • Use the System.IO.Packaging namespace?
  • Use interop with the Shell?
  • Third party library for .NET?
  • Interop with open source unmanaged DLL?

[I can target Framework 3.5; best = easiest to design, implement, and maintain.]

I am mostly interested in why you think the chosen approach is best.

like image 400
Bill Avatar asked Dec 21 '08 21:12

Bill


People also ask

How do I create an archive zip file?

Press and hold (or right-click) the file or folder, select (or point to) Send to, and then select Compressed (zipped) folder. A new zipped folder with the same name is created in the same location.

Can you create multiple zip files at once?

To place multiple files into a zip folder, select all of the files while hitting the Ctrl button. Then, right-click on one of the files, move your cursor over the “Send to” option and select “Compressed (zipped) folder”.

What is the difference between zip and archive?

As mentioned above, the files archived in a Zip file are usually, but not always, compressed. This saves space and also makes it easier to send them as email attachments. Zip files are also convenient for grouping data files.


1 Answers

I've always used SharpZipLib

Forgot the why part: Mainly because its been around for a long time. It is well documented, and has an intuitive API. Plus it's open source if you're into that type of thing.

like image 116
Greg Dean Avatar answered Oct 08 '22 03:10

Greg Dean