// Collection of code snippets by Arne Vajhøj // (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) using System; using System.IO; using ICSharpCode.SharpZipLib.Zip; class TestClass { public const int N = 100; public static void Main(string[] args) { ZipOutputStream zos = new ZipOutputStream(new FileStream(@"C:\Test.zip", FileMode.Create)); for(int i = 0; i < N; i++) { FileStream fs = new FileStream(@"C:\Test.doc", FileMode.Open); byte[] b = new byte[fs.Length]; fs.Read(b, 0, b.Length); fs.Close(); ZipEntry ze = new ZipEntry("Test" + i + ".doc"); zos.PutNextEntry(ze); zos.Write(b, 0, b.Length); } zos.Finish(); zos.Close(); } }