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

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s