[]
        
(Showing Draft Content)

C1.Zip.C1ZipEntryCollection.Add

Add Method

Add(Stream, string, DateTime)

Adds a stream to the current zip file.

Declaration
public void Add(Stream stream, string entryName, DateTime dateTime)
Parameters
Type Name Description
Stream stream

Stream that contains data for the new entry.

string entryName

Name to be used for the new entry.

DateTime dateTime

The date and time when the file was last modified.

Add(Stream, string)

Adds a stream to the current zip file.

Declaration
public void Add(Stream stream, string entryName)
Parameters
Type Name Description
Stream stream

Stream that contains data for the new entry.

string entryName

Name to be used for the new entry.

Add(string)

Adds an entry to the current zip file.

Declaration
public void Add(string fileName)
Parameters
Type Name Description
string fileName

Name of the file to add to the zip file.

Remarks

By default, the directory name is not stored in the zip file. To store a specific part of the directory name in the zip file, use the overloaded version of the Add method with a pathLevels parameter.

Add(string[])

Adds a list of entries to the current zip file.

Declaration
public void Add(string[] fileNames)
Parameters
Type Name Description
string[] fileNames

Array containing the file names of the entries to be added to the zip file.

Add(string, int)

Adds an entry to the current zip file.

Declaration
public void Add(string fileName, int pathLevels)
Parameters
Type Name Description
string fileName

Name of the file to add to the zip file.

int pathLevels

The number of path levels to be stored as the entry name.

Remarks

By default, path names are not stored in the zip file. For example, adding the file "c:\temp\samples\readme.txt" to the zip file will create an entry called "readme.txt".

The pathLevels parameter allows you to store one or more levels of the path in the entry name. For example, adding the file "c:\temp\samples\readme.txt" to the zip file with pathLevels=1 will create an entry called "samples\readme.txt".

Add(string, string)

Adds an entry to the current zip file.

Declaration
public void Add(string fileName, string entryName)
Parameters
Type Name Description
string fileName

Name of the file to add to the zip file.

string entryName

Name of the new entry as stored in the zip file.

Remarks

By default, entries in the zip file have the same name as the original (uncompressed) file. This method allows you to specify a different name, including a path for example.

Add(string, string, DateTime)

Adds an entry to the current zip file.

Declaration
public void Add(string fileName, string entryName, DateTime dateTime)
Parameters
Type Name Description
string fileName

Name of the file to add to the zip file.

string entryName

Name of the new entry as stored in the zip file.

DateTime dateTime

The date and time when the file was last modified.

Remarks

By default, entries in the zip file have the same name as the original (uncompressed) file. This method allows you to specify a different name, including a path for example.