AddDirectory Method (directoryName)

DotNetZip

Ionic Zip Library v1.9.1.6 AddDirectory Method (directoryName)
ReferenceIonic.ZipZipFileAddDirectory(String)
Adds the contents of a filesystem directory to a Zip file archive.
Declaration Syntax
C# Visual Basic Visual C++
public ZipEntry AddDirectory(
	string directoryName
)
Public Function AddDirectory ( _
	directoryName As String _
) As ZipEntry
public:
ZipEntry^ AddDirectory(
	String^ directoryName
)
Parameters
directoryName (String)
The name of the directory to add.
Return Value
The ZipEntry added.
Remarks

The name of the directory may be a relative path or a fully-qualified path. Any files within the named directory are added to the archive. Any subdirectories within the named directory are also added to the archive, recursively.

Top-level entries in the named directory will appear as top-level entries in the zip archive. Entries in subdirectories in the named directory will result in entries in subdirectories in the zip archive.

If you want the entries to appear in a containing directory in the zip archive itself, then you should call the AddDirectory() overload that allows you to explicitly specify a directory path for use in the archive.

For ZipFile properties including Encryption, Password, SetCompression, ProvisionalAlternateEncoding, ExtractExistingFile, ZipErrorAction, and CompressionLevel, their respective values at the time of this call will be applied to each ZipEntry added.

Assembly: Ionic.Zip (Module: Ionic.Zip) Version: 1.9.1.8 (1.9.1.8)