user380432
user380432

Reputation: 4779

C# Xceed Unzip unzipping file according to list object data path

I have a list object in my application:

List<TestData> data = new ExportBM().GetData();

This list object contains an ImportDirectory field. I want to use Xceed Unzip to unzip the files in the ImportDirectory

so far I have the following:

    foreach (TestData item in data)
            {
                item.ImportDirectory
            }

What is the method in xceedd unzip to unzip the files according to a passed filepath? Is there one?

Upvotes: 0

Views: 930

Answers (1)

Sorax
Sorax

Reputation: 2203

Is QuickZip.Unzip what you're looking for? You might need something like:

foreach (TestData item in data)
{
   string[] files = Directory.GetFiles(item.ImportDirectory, "*.zip");
   foreach(string file in files)
   {
      QuickZip.Unzip(file, "c:\\", string.Empty, true, true, false, null, null, "*" ); 
   }    
}

Edit

I added examples of the rest of the arguments. The last being filesToUnzip which is a params that is looking for file paths within the archive to unzip. It allows you to do partial unzips explicitly or based on masks. In this case the mask "*" will be read as a wildcard and all files will be unzipped.

Upvotes: 1

Related Questions