How do place files in zip folder programmitcally

ImDaFrEaK

Well-known member
Joined
Jan 7, 2006
Messages
416
Location
California
Programming Experience
5-10
That's just it. How do I place a file in a zip folder programmatically?
 
A zip is really a file, not a folder, but with Windows XP it is built into the Explorer to handle these files as folders. To use this feature programmatically add first reference to COM library 'Microsoft Shell Controls And Automation'. Then use the ShellClass and CopyHere method. There are some code examples here:
- compress (existing and new zip): http://www.xtremevbtalk.com/showthread.php?t=263973
- decompress: http://www.codeproject.com/csharp/decompresswinshellapics.asp

Else there exist a number of libraries (free or pay) to handle compressed archives like zips.
 
Speaking of which, the not unknown free library SharpZipLib updated to version 0.85 just the other day and now supports adding files to existing ZipFile.
 
Back
Top