Zip utility to zip directory contents  
Author Message
learnerplates





PostPosted: .NET Base Class Library, Zip utility to zip directory contents Top

How can I zip the contents of a directory programmatically

GZipStream zips and unzips files, is there some way to manipulate this to zip a directory (recursively)

Is there another .NET utility out there

I'm developing in C#.


Thanks.


.NET Development26  
 
 
lwmorris067





PostPosted: .NET Base Class Library, Zip utility to zip directory contents Top

If you're using .Net 2.0, you can use the GZip or Deflate streams.

See http://msdn2.microsoft.com/en-gb/library/system.io.compression.gzipstream.aspx for an example or lookup GZipStream class in your help.

If you have .Net 1.x, you'll need some help. I liked to use SharpZipLib at http://www.icsharpcode.net/


 
 
learnerplates





PostPosted: .NET Base Class Library, Zip utility to zip directory contents Top

.NET 2.0.
I've been playing with same example but it looks to me like it's only for Zipping single files!

How can I unzip an existing .zip file (it will contain various files) replace some of the files and then rezip




 
 
lwmorris067





PostPosted: .NET Base Class Library, Zip utility to zip directory contents Top

Did you take a look at sharpziplib I believe it has the ability to zip a directory.