Reputation: 11
What is the best way to convert a whole folder (including it's contents) into a .zip
file?
Upvotes: 0
Views: 2544
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
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