AddFiles Method (fileNames, directoryPathInArchive)

DotNetZip

Ionic Zip Library v1.9.1.6 AddFiles Method (fileNames, directoryPathInArchive)
ReferenceIonic.ZipZipFileAddFiles(IEnumerable<(Of <<'(String>)>>), String)
Adds a set of files to the ZipFile, using the specified directory path in the archive.
Declaration Syntax
C# Visual Basic Visual C++
public void AddFiles(
	IEnumerable<string> fileNames,
	string directoryPathInArchive
)
Public Sub AddFiles ( _
	fileNames As IEnumerable(Of String), _
	directoryPathInArchive As String _
)
public:
void AddFiles(
	IEnumerable<String^>^ fileNames, 
	String^ directoryPathInArchive
)
Parameters
fileNames (IEnumerable<(Of <(<'String>)>)>)
The names of the files to add. Each string should refer to a file in the filesystem. The name of the file may be a relative path or a fully-qualified path.
directoryPathInArchive (String)
Specifies a directory path to use to override any path in the file name. Th is path may, or may not, correspond to a real directory in the current filesystem. If the files within the zip are later extracted, this is the path used for the extracted file. Passing null (Nothing in VB) will use the path on each of the fileNames, if any. Passing the empty string ("") will insert the item at the root path within the archive.
Remarks

Any directory structure that may be present in the filenames contained in the list is "flattened" in the archive. Each file in the list is added to the archive in the specified top-level directory.

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)