AddItem Method (fileOrDirectoryName)

DotNetZip

Ionic Zip Library v1.9.1.6 AddItem Method (fileOrDirectoryName)
ReferenceIonic.ZipZipFileAddItem(String)
Adds an item, either a file or a directory, to a zip file archive.
Declaration Syntax
C# Visual Basic Visual C++
public ZipEntry AddItem(
	string fileOrDirectoryName
)
Public Function AddItem ( _
	fileOrDirectoryName As String _
) As ZipEntry
public:
ZipEntry^ AddItem(
	String^ fileOrDirectoryName
)
Parameters
fileOrDirectoryName (String)
the name of the file or directory to add.
Return Value
The ZipEntry added.
Remarks

This method is handy if you are adding things to zip archive and don't want to bother distinguishing between directories or files. Any files are added as single entries. A directory added through this method is added recursively: all files and subdirectories contained within the directory are added to the ZipFile.

The name of the item may be a relative path or a fully-qualified path. Remember, the items contained in ZipFile instance get written to the disk only when you call Save()()()() or a similar save method.

The directory name used for the file within the archive is the same as the directory name (potentially a relative path) specified in the fileOrDirectoryName.

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 the ZipEntry added.

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