Ionic Zip Library v1.9.1.6
AddSelectedFiles Method (selectionCriteria, directoryOnDisk)
Adds to the ZipFile a set of files from a specified directory in the
filesystem, that conform to the specified criteria.
Declaration Syntax
Remarks
This method selects files that conform to the specified criteria, from the the specified directory on disk, and adds them to the ZipFile. The search does not recurse into subdirectores.
Using this method, the full filesystem path of the files on disk is reproduced on the entries added to the zip file. If you don't want this behavior, use one of the other overloads of this method.
For details on the syntax for the selectionCriteria parameter, see AddSelectedFiles(String).
Examples
This example zips up all *.xml files larger than 1mb in the directory
given by "d:\rawdata".
CopyC#
using (ZipFile zip = new ZipFile()) { // Use a compound expression in the selectionCriteria string. zip.AddSelectedFiles("name = *.xml and size > 1024kb", "d:\\rawdata"); zip.Save(PathToZipArchive); }
CopyVB.NET
Using zip As ZipFile = New ZipFile() ' Use a compound expression in the selectionCriteria string. zip.AddSelectedFiles("name = *.xml and size > 1024kb", "d:\rawdata) zip.Save(PathToZipArchive) End Using