Month: January 2013

How to: Using SharpZipLib

Create a zip file

FastZip fastZip = new FastZip();

string zipFileName; // The name of the zip file to create.
string sourceDirectory; // The directory to obtain the files and directories from.
bool recurse;  // True to recurse directories, false for no recursion.
string fileFilter; // The file filter to apply, null = No filter
fastZip.CreateZip(zipFileName, sourceDirectory, recurse, fileFilter);

Extract the contents of a zip file

FastZip fastZip = new FastZip();

string zipFileName; // The zip file to extract from.
string targetDirectory; // The directory to save extracted information in.
string fileFilter; // The file filter to apply, null = No filter
fastZip.ExtractZip(zipFileName, targetDirectory, fileFilter);

References