locked
How to Zip and UnZip Files using SharpZipLib? RRS feed

  • Question

  • hi
    i have to zip and unzip files? how can i do this?any sam[le code?
    Thursday, May 28, 2009 9:25 AM

Answers

  • Well, if your using one of the recent versions of SharpZipLib - for most needs the FastZip class can be your friend...

    Recursively compress a directory:

    FastZip fz = new FastZip();
    fz.CreateZip (pathToZipFile, pathToDirectoryToZip, true, "");

    Unzip it:
    FastZip fz = new FastZip();
    fz.ExtractZip (zipFilePath, extractionPath, null);
    If your needs are beyond that, there are lots of code examples on the internet :)
    Tom Shelton
    • Proposed as answer by Cor Ligthert Friday, May 29, 2009 11:14 AM
    • Marked as answer by Harry Zhu Thursday, June 4, 2009 8:48 AM
    Thursday, May 28, 2009 9:58 PM
  • Hi,
      You can do it with the help of a third party dll called iCsharpCode.dll whcih is free of cost. The source code you will get at the follwoing link.
       http://www.codeproject.com/KB/cs/console_zip.aspx


    -- Thanks Ajith R [Remember to Mark as Answer if it is Helpful.]
    • Marked as answer by Harry Zhu Thursday, June 4, 2009 8:48 AM
    Thursday, May 28, 2009 9:44 AM
  • Download the SharpZip source and samples file.

    • Proposed as answer by Cor Ligthert Friday, May 29, 2009 11:15 AM
    • Marked as answer by Harry Zhu Thursday, June 4, 2009 8:48 AM
    Thursday, May 28, 2009 10:10 AM
  • take a look at System.IO.Packaging for native .Net zip an unzip possibilities.
    it works as a charm.

    Aale
    • Proposed as answer by psk452 Monday, June 1, 2009 6:08 PM
    • Marked as answer by Harry Zhu Thursday, June 4, 2009 8:48 AM
    Thursday, May 28, 2009 10:59 AM
  • Do you ouy some for Zip and unzip?

    My guess would be than CreateZipFile would Zip and unzipfile would unzip.  At least that's what the readme's say.
    • Marked as answer by Harry Zhu Thursday, June 4, 2009 8:48 AM
    Thursday, May 28, 2009 6:15 PM

All replies

  • Hi,
      You can do it with the help of a third party dll called iCsharpCode.dll whcih is free of cost. The source code you will get at the follwoing link.
       http://www.codeproject.com/KB/cs/console_zip.aspx


    -- Thanks Ajith R [Remember to Mark as Answer if it is Helpful.]
    • Marked as answer by Harry Zhu Thursday, June 4, 2009 8:48 AM
    Thursday, May 28, 2009 9:44 AM
  • Download the SharpZip source and samples file.

    • Proposed as answer by Cor Ligthert Friday, May 29, 2009 11:15 AM
    • Marked as answer by Harry Zhu Thursday, June 4, 2009 8:48 AM
    Thursday, May 28, 2009 10:10 AM
  • Do you ouy some for Zip and unzip?
    Thursday, May 28, 2009 10:13 AM
  • take a look at System.IO.Packaging for native .Net zip an unzip possibilities.
    it works as a charm.

    Aale
    • Proposed as answer by psk452 Monday, June 1, 2009 6:08 PM
    • Marked as answer by Harry Zhu Thursday, June 4, 2009 8:48 AM
    Thursday, May 28, 2009 10:59 AM
  • Stop duplicate thread, your previous is here
    http://social.msdn.microsoft.com/Forums/en-US/csharplanguage/thread/00c79129-a034-459c-81db-576f45a6b5c3

    try  this http://www.codeplex.com/DotNetZip

    kaymaf

     


    I hope this helps, if that is what you want, just mark it as answer so that we can move on
    Thursday, May 28, 2009 12:16 PM
  • Do you ouy some for Zip and unzip?

    My guess would be than CreateZipFile would Zip and unzipfile would unzip.  At least that's what the readme's say.
    • Marked as answer by Harry Zhu Thursday, June 4, 2009 8:48 AM
    Thursday, May 28, 2009 6:15 PM
  • Well, if your using one of the recent versions of SharpZipLib - for most needs the FastZip class can be your friend...

    Recursively compress a directory:

    FastZip fz = new FastZip();
    fz.CreateZip (pathToZipFile, pathToDirectoryToZip, true, "");

    Unzip it:
    FastZip fz = new FastZip();
    fz.ExtractZip (zipFilePath, extractionPath, null);
    If your needs are beyond that, there are lots of code examples on the internet :)
    Tom Shelton
    • Proposed as answer by Cor Ligthert Friday, May 29, 2009 11:14 AM
    • Marked as answer by Harry Zhu Thursday, June 4, 2009 8:48 AM
    Thursday, May 28, 2009 9:58 PM
  • Download the SharpZip source and samples file.


    Saturday, August 22, 2009 8:20 AM