One of my collegue was enquiring whether we could zip a folder of files programmatically using .NET. Though I told him its possible, I couldn't remember the URL where I have read about it in MSDN.
To be frank the first option which came to my mind was to use some third party components to do this task. But after little bit of googling I was able to find out the exact URL which explains the way to do it without using any third party components.
If at all you are also interested in that check out this MSDNMag article.
Extract:
Zip compression lets you save space and network bandwidth when storing files or sending them over the wire. In addition, you don't lose the directory structure of folders you Zip, which makes it a pretty useful compression scheme. The C# language doesn't have any classes that let you manipulate Zip files, but since .NET-targeted languages can share class implementations, and J# exposes classes in the java.util.zip namespace, you can get to those classes in your C# code.
To be frank the first option which came to my mind was to use some third party components to do this task. But after little bit of googling I was able to find out the exact URL which explains the way to do it without using any third party components.
If at all you are also interested in that check out this MSDNMag article.
Extract:
Zip compression lets you save space and network bandwidth when storing files or sending them over the wire. In addition, you don't lose the directory structure of folders you Zip, which makes it a pretty useful compression scheme. The C# language doesn't have any classes that let you manipulate Zip files, but since .NET-targeted languages can share class implementations, and J# exposes classes in the java.util.zip namespace, you can get to those classes in your C# code.
This article explains how to use the Microsoft J# class libraries to create an application in C# that compresses and decompresses Zip files. It also shows other unique parts of the J# runtime you can use from any .NET-compliant language to save some coding.
Comments
SharpZipLib, pure C#.
Jason