1. DON'T SHOUT!
2. I use ICSharpCode.SharpZipLib which can be freely downloaded and also used in commercial applications.
Code looks like that:
foreach (string folderToZip in foldersToZip)
{
if (!string.IsNullOrWhiteSpace(folderToZip) && Directory.Exists(folderToZip))
{
string targetFile = Path.Combine(targetFolder, Path.GetFileName(folderToZip) + ".zip");
ZipPath(targetFile, folderToZip, null, true, null);
}
}
and
public static void ZipPath(string zipFilePath, string sourceDir, string pattern, bool withSubdirs, string password)
{
FastZip fz = new FastZip();
if (password != null)
fz.Password = password;
fz.CreateZip(zipFilePath, sourceDir, withSubdirs, pattern);
}