ZipArchive for MonoTouch

Compressing files in MonoTouch just got easier!

ZipArchive is taken from the Obj-C world. And it is by far one of the simplest, most elegant solutions I’ve seen for compressing files to an archive. Just open an archive, add files to compress and close it.

var zipFile = new LibZipArchive.ZipArchive();
zipFile.CreateZipFile2("/path/to/archive/file.zip");
zipFile.AddFile("/path/of/file/to/somefile.txt", "somefile.txt");
// add more files as needed
zipFile.CloseZipFile2();

The Obj-C library and bindings to C# can be found in the open source project monotouch-ziparchive on github.

Advertisements