This project is read-only.

Problem with password - can open files without password

Jun 3, 2010 at 5:24 AM

Hi people, I'm having a problem with the password, I set one in my code but when I try to open the zip, no password is requiered, here is my code:

SevenZipCompressor.SetLibraryPath(Path.Combine(Environment.CurrentDirectory, "7z.dll"));                            

SevenZipCompressor szc = new SevenZipCompressor(tmp);                

szc.CompressionLevel = CompressionLevel.Ultra;              

 szc.CompressionMethod = CompressionMethod.Default;                

szc.CompressionMode = CompressionMode.Create;              

szc.VolumeSize = mySplitSize * 1024 * 1024;                

szc.ZipEncryptionMethod = ZipEncryptionMethod.Aes256;                

szc.ArchiveFormat = OutArchiveFormat.SevenZip;              

szc.CompressDirectory(@origin, zipfilename, true,myPasswordZip);                

All this code run ok, but I can open my final files without password. I'm doing something wrong?



Jun 5, 2010 at 1:15 AM


Works fine here. I know this might sound silly but are you passing an empty string for myPasswordZip?





Jun 5, 2010 at 4:31 AM

You are right!!! I feel so bad, myPasswordZip was an empty string, lots of thanks my friend!

Jun 5, 2010 at 11:02 AM


Welcome mate. Glad it was something simple. :)