If you use SharpZipLib (http://www.icsharpcode.net/OpenSource/SharpZipLib/Default.aspx), this is really pretty straightforward.

ZipFile z = ZipFile.Create(archiveName);

z.BeginUpdate();
string[] zipFiles = Directory.GetFiles((string)sPathToLoad, "*1.0.xls");

          foreach (string f in Files)         // Loop round each file
          {
                    Console.WriteLine("    Adding "+f);
                    z.Add(f);
                }

z.CommitUpdate();
z.Close();

Advertisements