views:

112

answers:

2

Is it possible to programmatically zip/unzip files in vb.net? Meaning, not that it will extract the files for the user, but take the files inside the zip and be able to use them in the application? Then, is it possible for this to create a zip?

I couldn't seem to find a compression namespace anywhere.

Thanks for the help!

+2  A: 

We used SharpZibLib in the past with great success.

You can also have look at the System.IO.Compression namespace, it provides the functionality compress and decompress streams but unfortunately not the functionality to extract files from a Zip file :(

Update:
I wasn't aware of this namespace System.IO.Packaging, seems it can indeed deal with files 'packed' into a zip file.

Philip Fourie
Hmm, looks good, ill have to take a look at it. Ill also look at that namespace....
Cyclone
system.io.packaging is more built around working with the new office formats .docx, .xlsx, etc, which are just essentially zip files. From my experience it doesn't handle the standard zip format all that well. I make use of DotNetZip, which seems to work better for me than SharpZipLib, and it's better maintained and updated by the developers.
BBlake
A: 

For an excellent commercial solution try http://xceed.com/

We have used this and it's great for working with zip file (and for merging and creating self-extracting zips if this is required)

note: Not affiliated with Xceed in any way.

Mark Redman
Bit costly, but seems nice. Is there a free one?
Cyclone
Your best bet is to evaluate them all and choose the one that does the job. After starting to write a whole lot of code to wrap the methods and search the net for extra help, I went for a commercial, royalty free, well supported solution. Its worth the money sometimes.
Mark Redman
True. Ill wait till I sell a few copies of my own software before I purchase any utilities though.
Cyclone