ComponentOne Zip for .NET
C1ZipFile Class
Members  Example 

C1.C1Zip.4 Assembly > C1.C1Zip Namespace : C1ZipFile Class
Used for creating, opening, and managing zip files.
Object Model
C1ZipFile ClassC1ZipEntryCollection ClassC1ZipEntry Class
Public Class C1ZipFile 
public class C1ZipFile 

Use the Open(Stream) or Create(Stream) methods to associate the C1Zip file object with a zip file on disk. Then use the Entries property to add, remove, retrieve, or inspect individual entries in the zip file.

C1ZipFile can only be used with standard zip files. The component does not support other similar formats such as gzip, zip2, tar, or rar.

The standard zip file imposes some limitations on the size of each entry. You cannot use it to compress files larger than 4 gigabytes (uint.MaxValue).

The code below creates a zip file called and adds all files with a "cs" extension to the zip file:
// get path for zip file and files to compress
string path = Application.ExecutablePath;
int pos = path.IndexOf(@"\bin");
path = path.Substring(0, pos + 1);
// create a zip file
C1ZipFile zip = new C1ZipFile();
zip.Create(path + "");
// add all files with extension cs to the zip file
foreach (string fileName in Directory.GetFiles(path, "*.cs"))
// show result
foreach (C1ZipEntry ze in zip.Entries)
	Console.WriteLine("{0} {1:#,##0} {2:#,##0}", 
		ze.FileName, ze.SizeUncompressed, ze.SizeCompressed);
Inheritance Hierarchy


See Also


C1ZipFile Members
C1.C1Zip Namespace