i'm working on the program to zip the zipped files in a folder with a password protected. For example i have multiple zipped file in a folder D:\Work\ZippedFile which is ABC.zip, CDE.zip, TZE.zip. I want to zip all the zipped file into one zip file named AllFile.zip with a password protected. What have i tried so far is as below:
string[] dirs = Directory.GetDirectories(@"D:\Work\ZippedFile");
foreach (string dir in dirs)
if (file.Contains(".zip"))
{
using (var zip = new ZipFile())
{
string filename = file.Substring(51);
zip.Password = "Abc!23";
zip.Encryption = EncryptionAlgorithm.WinZipAes256;
zip.AddFile(file, "");
zip.Save(dir + "\\" + "AllFile.zip");
}
}
I know this will output a single zip file for each zipped file, I hope somebody can give me an idea on how to achieve the right output. Thanks in advance.