How to use DotNetZip

14,939

Just add a reference to Ionic.Zip.dll - you do need to make sure you are using the right reference for your target framework version (silverlight, WPF etc)

Then the above code should work assuming you import the Ionic namespace

Also not sure what you mean by 'what project should I add' - you already have a project right, or is this just a test project and you need to create a new project? If so any project type will do - but the best tests are either a console app or a forms/wpf app

Share:
14,939

Related videos on Youtube

ELSheepO
Author by

ELSheepO

Just really started learning .NET and C#

Updated on June 13, 2022

Comments

  • ELSheepO
    ELSheepO almost 2 years

    I've downloaded DotNetZip from codeplex and I am totally lost as to what to do next.

    I want to extract a .zip archive

    I know I use something like this

    string zipToUnpack = "C1P3SML.zip";
    string unpackDirectory = "Extracted Files";
    using (ZipFile zip1 = ZipFile.Read(zipToUnpack))
    {
        // here, we extract every entry, but we could extract conditionally
        // based on entry name, size, date, checkbox status, etc.  
        foreach (ZipEntry e in zip1)
        {
          e.Extract(unpackDirectory, ExtractExistingFileAction.OverwriteSilently);
        }
    }
    

    My question is, what project do I add and/or what references do I add?

    Thanks

  • ELSheepO
    ELSheepO almost 12 years
    I had to add a project before I could use another discutils download so was wondering if i needed to do the same for this.
  • Charleh
    Charleh almost 12 years
    You can just add the reference to your current project (main project, library project etc) - it should work fine
  • ELSheepO
    ELSheepO almost 12 years
    Ya I got it working, was just explaining why I asked what project to add, thanks
  • Kurtis Cochrane
    Kurtis Cochrane over 7 years
    I was too busy looking to add a reference to DotNetZip, didn't think to look for an use Ionic.Zip.dll
  • Aelgawad
    Aelgawad about 6 years
    Hi @Charleh , I am unable to find the file Ionic.Zip.dll, is there a project I should compile?