Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void Zip(string path, string outputPath)
- {
- using (ZipFile zip = new ZipFile())
- {
- zip.AddDirectory(path);
- zip.Password = "password";
- zip.Save(outputPath);
- }
- }
- using (ZipFile zip = new ZipFile())
- {
- zip.Password = "password";
- zip.AddDirectory(path);
- zip.Save(outputPath);
- }
- using (ZipFile zip = new ZipFile())
- {
- //this won't be password protected
- zip.AddDirectory(unprotectedPath);
- zip.Password = "password";
- //...but this will be password protected
- zip.AddDirectory(path);
- zip.Save(outputPath);
- }
Add Comment
Please, Sign In to add comment