Xceed Zip Compression Library Documentation
FilesToExclude property example
Example topics > FilesToExclude property example

Suppose we have the following files on a given drive mapped to H:

H:\

----------DATA\

--------------------BACKUPS\

------------------------------DOCS\  

----------------------------------------DOC1.DOC

----------------------------------------DOC2.DOC

----------------------------------------DOC3.PDF

----------------------------------------DOC4.TXT

------------------------------PICS\

----------------------------------------PIC1.BMP

----------------------------------------PIC2.BMP

----------------------------------------PIC3.GIF

----------------------------------------PIC4.JPEG

------------------------------JUNK\

----------------------------------------ERASE.ME

ROOT.TXT 

To process all the files on drive H: except files ending with ".txt" set the FilesToProcess and FilesToExclude properties to the following values: 

FilesToProcess = "C:\*"

FilesToExclude = "*.TXT" 

To process all the .TXT files on drive H: except those starting with D, set the FilesToProcess and FilesToExclude properties to the following values:

FilesToProcess = "H:\*.TXT"

FilesToExclude = "D*"

To process all the files and folders in the "H:\DATA\BACKUPS" folder but excluding the contents of the "h:\DATA\BACKUPS\PICS" folder set the FilesToProcess and FilesToExclude properties to the following values: 

FilesToProcess = "H:\DATA\BACKUPS\*"

FilesToExclude = "H:\DATA\BACUPS\PICS\*"