High Level: C1ZipFile, C1ZipEntry and C1ZipEntryCollection Classes

These are the highest level classes in the C1Zip library. They allow you to create and manage zip files. Using zip files to store application data provides the following benefits:

      You can consolidate many files into one, making application deployment easier.

      You can compress the data, saving disk space and network bandwidth.

      The zip format is an open standard, supported by many popular applications.

C1ZipFile Class

The C1ZipFile class encapsulates a zip file. After you create a C1ZipFile object, you can attach it to an existing zip file or tell it to create a new empty zip file for you.

The code below creates a zip file called sources.zip and adds all files with a "cs" extension to the zip file:

      C#

C1ZipEntryCollection Class

After you have created or opened a zip file, use the Entries collection to inspect the contents of the zip file, or to add, expand, and delete entries. For example:

      Visual Basic

      C#

C1ZipEntry Class

The C1ZipEntry class exposes properties and methods that describe each entry, including its original file name, size, compressed size, and so on. It also has a OpenReader method that returns a stream object, so you can read the entry contents without expanding it first.


Send us comments about this topic.
Copyright © GrapeCity, inc. All rights reserved.