I'm currently trying to add a folder to a preexisting zip folder in C#. However, I do not know how I would go about this. I've tried using utilities like Aspose.Zip, however, that overwrites the zip file. Here's the current function I have that uses Aspose.Zip:
public static void addFolderToZipFile(string zipName, string folderPath)
{
using(FileStream file = File.Open(zipName, FileMode.Open, FileAccess.ReadWrite))
{
using(Archive archive = new Archive())
{
DirectoryInfo info = new DirectoryInfo(@folderPath);
archive.CreateEntries(info);
archive.Save(file);
archive.Dispose();
file.Dispose();
}
}
}
Any ideas? Thanks.