Home Forums .NET libraries Xceed Zip & Real-Time Zip for .NET How can I unzip a folder?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #19529 |

    Hi,
    I use this code to zip “c:\test” folder:

    Xceed.Zip.Licenser.LicenseKey = “SAMPLE-APPLICATION-KEY”
    Dim diskFolder As New DiskFolder(“c:\temp”)
    Dim FisierZip As New ZipArchive(New DiskFile(“c:\test.zip”))
    diskFolder.CopyTo(FisierZip, True)

    Now,
    How do I unzip a subfolder of folder “temp” with all it’s files?
    How do I unzip “test” folder with all subfolder, files and empty subfolder?

    I try this:
    Xceed.Zip.Licenser.LicenseKey = “SAMPLE-APPLICATION-KEY”
    Dim diskFolder As New DiskFolder(“c:\”)
    Dim FisierZip As New ZipArchive(New DiskFile(“c:\test.zip”))
    FisierZip.CopyTo(diskFolder, True)

    but an eror apears:
    ” Cannot perform the requested operation on an item that is a root folder.
    Type: Xceed.Zip.ZipArchive
    FullName: \ “

    Thank you!

    Imported from legacy forums. Posted by smire_x (had 3582 views)

    User (Old forums)
    Member
    Post count: 23064

    When I use this code:

    Xceed.Zip.Licenser.LicenseKey = “SAMPLE-APPLICATION-KEY”
    Dim diskFolder As New DiskFolder(“c:\”)
    Dim FisierZip As New ZipArchive(New DiskFile(“c:\test.zip”))
    FisierZip.CopyFilesTo(diskFolder, True, True, “*”)

    it works, but empty folders are not unziped!
    How can I unzip empty folders?
    and how can I unzip just one folder’ subfolders and files?

    Imported from legacy forums. Posted by smire_x (had 292 views)

    User (Old forums)
    Member
    Post count: 23064

    You can call the GetFolder method on any AbstractFolder, like a DiskFolder or a ZipArchive (ZippedFolder). For example:

    Dim diskFolder As New DiskFolder(“c:\”)
    Dim FisierZip As New ZipArchive(New DiskFile(“c:\test.zip”))

    FisierZip.GetFolder( “mySubFolder” ).CopyTo( diskFolder, True )

    Obviously, you could put some code to make sure “mySubFolder” exists…

    Imported from legacy forums. Posted by Martin (had 396 views)

    User (Old forums)
    Member
    Post count: 23064

    I try GetFolder method and it is work… thank you Martin!

    Now, if I don’t buging you,
    How can I unzip all file, folders, subfolders and empty foleders from a zip file?

    and,
    How can I connect a progressbar to a zipping or an unzipping process?

    Imported from legacy forums. Posted by smire_x (had 4121 views)

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