Home Forums .NET libraries Xceed Zip & Real-Time Zip for .NET Unzipping with a filter

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • User (Old forums)
    Post count: 23064
    #19914 |

    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)

    Xceed Support
    Post count: 5658

    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.

    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”))

    Imported from legacy forums. Posted by CharlesB (had 3315 views)

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.