How can I password protect the whole .zip file and not each file

Dec 16, 2016 at 1:38 AM
Hello,

I have been working with this class on many C# projects.

But for my current project, I would like to have a password only on main say sample.zip file.

Not on each zip within this sample.zip file, since it would not be a good user experience to have to input the same password or different one on each file with the sample.zip file.

My current testing code.
using (ZipFile zip = new ZipFile())
            {
                zip.Password = "123456!";
                zip.AddFile(@"C:\Temp\ReadMe.txt"); // no password for this one
                zip.AddFile(@"C:\Temp\image1.jpg");
                zip.AddFile(@"C:\Temp\Installme.msi");

                zip.Save("Backup.zip");
So, when you unzip this file, you can see each file, but if you want to read, edit, you will be prompted for the password.

I would like you to have to enter the password once and then have access to any file.

Thanks,