9

My requirements:

  • Support .NET Compact Framework 2.0 and Windows Mobile 6.0 devices.
  • Only need to unzip the contents to a directory on a storage card. Creation of zip files is not required.
  • Must be able to use in corporate/commercial software.
  • Can be open source, but not have GPL or other viral license.

I've seen the Xceed Zip for CF library. What other options are there?

Oli
  • 235,628
  • 64
  • 220
  • 299
Brian Lyttle
  • 14,558
  • 15
  • 68
  • 104

5 Answers5

5

As of v1.7, the DotNetZip distribution now includes a version built specifically for the .NET Compact Framework, either v2.0 or v3.5. http://www.codeplex.com/DotNetZip/Release/ProjectReleases.aspx. It is about ~70k DLL. It does zip, unzip, zip editing, passwords, ZIP64, unicode, streams, and more.

DotNetZip is 100% managed code, open source, and free/gratis to use. It's also very simple and easy.

  try
  {
      using (var zip1 = Ionic.Zip.ZipFile.Read(zipToUnpack))
      {
          foreach (var entry in zip1)
          {
              entry.Extract(dir, ExtractExistingFileAction.OverwriteSilently);
          }
      }
  }
  catch (Exception ex)
  {
      MessageBox.Show("Exception! " + ex);
  }

There's a sample app included in the source distribution that unzips to a storage card.

CF-Unzipper app http://www.freeimagehosting.net/uploads/ce5ad6a964.png

Cheeso
  • 189,189
  • 101
  • 473
  • 713
  • Out of curiosity, why built for CF 3.5? CF 3.5 *has* compression support built in. It would be far more useful if it were built for 2.0, which there is still a significant install base and which *doesn't* have compression support. – ctacke Dec 23 '08 at 15:26
  • 1
    Where in the .NET Compact Framework 3.5 are ZIP archives supported? System.IO.Compression is only for the deflate/gzip compression algorithms. They do NOT support the ZIP file format. – Martin Plante Dec 23 '08 at 16:26
  • Both of you have points. Ctacke, you're right, there are many more CF 2.0 devices around. Slim - you are also correct: the .NET Framework (desktop or CF, 3.5 or 2.0) does not provide built-in support for managing zips. In any case, I've updated v1.7 of DotNetZip so that it now runs on CF 2.0. – Cheeso Jan 04 '09 at 03:14
3

Have a look at #ziplib (www.icsharpcode.com). It's GPL, but you can use it in closed-source, commercial applications. They don't say anything specifically on their page about using it with the Compact Framework, so you'd have to give it a test yourself (that said, it's pure C# without any external dependencies, so the chances are somewhat good that it will work).

TheSmurf
  • 15,337
  • 3
  • 40
  • 48
1

Looks like what you need is zlibCE from the OpenNETCF foundation. You can get it here: http://opennetcf.com/FreeSoftware/zlibCE/tabid/245/Default.aspx

It's a port of the linux zlib library to CE. At it's core, it's a native dll, but they now also provide a .NET wrapper, along with all the source code.

I've used it in projects before and it performed quite well.

Adam Haile
  • 30,705
  • 58
  • 191
  • 286
1

This looks like it may be a good option for you: http://www.codeplex.com/DotNetZip. It seems small, has source and has a very open license (MS-PL).

denis phillips
  • 12,550
  • 5
  • 33
  • 47
0

I use the Resco MobileForms toolkit for a variety of functionality: http://www.resco.net/developer/mobileformstoolkit/overview.aspx

It includes a good ZIP library.

Gary Joynes
  • 656
  • 7
  • 23