Rajuu Parmar
Rajuu Parmar

Reputation: 11

How do you convert a folder to zip file?

What is the best way to convert a whole folder (including it's contents) into a .zip file?

Upvotes: 0

Views: 2544

Answers (3)

Evan M
Evan M

Reputation: 2611

I've used the Xceed Zip libraries in the past for this and found them very easy to use. The full license is quite pricey, but they do have a 45 day, 100% functional free trial available here:

http://xceed.com/Zip_Net_Intro.html

Upvotes: 0

Ken Wayne VanderLinde
Ken Wayne VanderLinde

Reputation: 19339

This appears to have your answer.

Upvotes: 1

Tomas Petricek
Tomas Petricek

Reputation: 243051

There is no class for doing this in the .NET Framework itself, but you can use some of the third-party libraries. An open-source DotNetZip seems to be quite good and has a lot of examples to get you started. You'll just need to recursively iterate over all files in the given folder and add them one by one.

Upvotes: 3

Related Questions