Use SharpZipLib to compress the entire directory (i.e. generate a storage directory in the compressed file) [This can be easily achieved using the built-in ZipFile.CreateFromDirectory starting from .Net4.5]

In projects starting from .Net 4.5, we can introduce the System.IO.Compression and System.IO.Compression.FileSystem (required to use the static class ZipFile) assemblies In this case, it is easy to compress the entire directory using the following static method: ZipFile.CreateFromDirectory //Note that the System.IO.Compression.FileSystem assembly needs to be introduced For projects before .Net 4.5, third-party compression libraries […]

Use ICSharpCode.SharpZipLib to compress and decompress

add reference using ICSharpCode.SharpZipLib.Zip; using ICSharpCode.SharpZipLib.Checksums; Compression and decompression class public class ZipHelper { /// <summary> /// ZIP: Decompress a zip file /// </summary> /// <param name=”ZipFile”>The Zip file to be decompressed (absolute path)</param> /// <param name=”TargetDirectory”>Decompressed directory</param> /// <param name=”Password”>Decompression password</param> /// <param name=”OverWrite”>Whether to overwrite existing files</param> public static void UnZip(string ZipFile, string […]