Home › Forums › .NET libraries › Xceed Zip & Real-Time Zip for .NET › Unzipping with a filter
I am trying to unzip a file, and need to send all the .RPT files to one folder and everything else to another.
The documentation is sparse, to say the least, and all seems to relate to zipping a folder with no example for unzipping.
Can anyone provide an example of unzipping files with a filter (in VB).
Imported from legacy forums. Posted by David (had 2228 views)
Here is a simple example that shows how you can use Filters.
In this example, my “TestFolder” contained files the “.txt” extension and other files with other extensions.
<code>Dim sourceFolder As AbstractFolder = New DiskFolder(“D:\TestFolder”) Dim zipFile As AbstractFile = New DiskFile(“D:\Forum11567\archive.zip”) Dim archive As New ZipArchive(zipFile)
sourceFolder.CopyFilesTo(archive, True, True, Nothing)
Dim destinationFolder1 As AbstractFolder = New DiskFolder(“D:\Forum11567\Test1”) Dim destinationFolder2 As AbstractFolder = New DiskFolder(“D:\Forum11567\Test2”)
archive.CopyFilesTo(destinationFolder1, True, True, “*.txt”) archive.CopyFilesTo(destinationFolder2, True, True, New NotFilter(“*.txt”)) </code>
Imported from legacy forums. Posted by CharlesB (had 3315 views)