+1 vote
by (8.6k points)
edited

How do I decompress a ZIP archive which is protected by a password using Rebex ZIP?

Applies to: Rebex ZIP

2 Answers

+1 vote
by (8.6k points)
edited
 
Best answer

Following code shows how to do it in C#:

// open a ZIP archive 
using (ZipArchive zip = new ZipArchive(@"C:\archive.zip", ArchiveOpenMode.Open))
{
    // set the Password first 
    zip.Password = "PASSword#123";

    // extract whole ZIP content 
    zip.ExtractAll(@"C:\Data");
}
+1 vote
by (8.6k points)
edited

Following code shows how to do it in VB.NET

' open a ZIP archive 
Using zip As New ZipArchive("C:\archive.zip", ArchiveOpenMode.Open)
    ' set the Password first 
    zip.Password = "PASSword#123"

    ' extract whole ZIP content 
    zip.ExtractAll("C:\Data")
End Using 
...