[]
Adds a stream to the current zip file.
public void Add(Stream stream, string entryName, DateTime dateTime)
| 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. |
Adds a stream to the current zip file.
public void Add(Stream stream, string entryName)
| Type | Name | Description |
|---|---|---|
| Stream | stream | Stream that contains data for the new entry. |
| string | entryName | Name to be used for the new entry. |
Adds an entry to the current zip file.
public void Add(string fileName)
| Type | Name | Description |
|---|---|---|
| string | fileName | Name of the file to add to the zip file. |
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.
Adds a list of entries to the current zip file.
public void Add(string[] fileNames)
| Type | Name | Description |
|---|---|---|
| string[] | fileNames | Array containing the file names of the entries to be added to the zip file. |
Adds an entry to the current zip file.
public void Add(string fileName, int pathLevels)
| 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. |
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".
Adds an entry to the current zip file.
public void Add(string fileName, string entryName)
| 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. |
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.
Adds an entry to the current zip file.
public void Add(string fileName, string entryName, DateTime dateTime)
| 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. |
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.