Zip Files RRS feed

  • Question

  • Does the .NET framework provide a C# interface to compress text files in a zip file?
    Monday, June 4, 2007 4:08 PM


All replies

  • Monday, June 4, 2007 4:32 PM
  • Not directly, you can try this though

    Monday, June 4, 2007 4:34 PM
  • No - GZipStream does not do Zip files.  This is a common misconception. 
    GZipStream can produce gzip files (they commonly use a .gz suffix).    They are not the same as zip files.

    There is System.IO.Packaging, but the code to manipulate zip files with this class is sort of laborious.

    There are third party libraries that work with .NET 2.0 and above - DotNetZip is a good one.  It exposes classes like ZipFile - with methods like AddFile() and Save() - and ZipEntry - with methods like Extract() .  DotNetZip lets you manipulate zip files easily.

    ps: DotNetZip is free (and open source).
    • Proposed as answer by cheeso Monday, March 9, 2009 5:37 PM
    Monday, March 9, 2009 5:37 PM