Reputation: 107
I want to compress an entire directory which can have any number of subdirectories into a single ZIP file.I'm using the Ionic.Zip dll for that, but I don't know how to proceed.
private void ZipFiles(string zipPath, string sourceDirectory, string strfilename)
{
using (ZipFile zip = new ZipFile())
{
zip.AddDirectory(sourceDirectory,zipPath);
}
}
Upvotes: 0
Views: 383
Reputation: 4255
Try to use SevenZipSharp like that:
SevenZipCompressor compressor = new SevenZipCompressor();
compressor.CompressDirectory(...);
Upvotes: 0