The answer above will work for several scenarios, but it will not work if you want to add an empty folder to the zip file.
I sifted through the SharpZipLib code and found that the only thing you need to do to create the folder is the trailing "/" slash in the ZipEntry name.
Here is the code from the library:
public bool IsDirectory { get { int nameLength = name.Length; bool result = ((nameLength > 0) && ((name[nameLength - 1] == '/') || (name[nameLength - 1] == '\\'))) || HasDosAttributes(16) ; return result; } }
So, just create the folders as if they were files with ZipEntry, and put a slash in the end. It is working. I tested it.
source share