Click here to Skip to main content
15,879,326 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I m trying to extract a zipped file through DotNetZip . The file is encrypted with a password and needs to be either reset or removed. I used ExtractAll method but received exception:
BadPasswordException was unhandled, the password didnot match.


What I have tried:

My code is below:
C#
using (Ionic.Zip.ZipFile zip = Ionic.Zip.ZipFile.Read(source_file))
{           
    zip.Password = "1234";
    zip.ExtractAll(dest_path, Ionic.Zip.ExtractExistingFileAction.OverwriteSilently);
}

Hopes For suggestion
Posted
Updated 9-Nov-16 22:16pm
v2
Comments
Tomas Takac 10-Nov-16 4:11am    
I guess the error message is clear. You need to know the password to unzip.

1 solution

If you do not know the password, then you will get this error.
And there is no way to extract the data without the correct password - that is the whole idea of applying a password to zip data.
If you don't have it, go back to the person who sent you the file, and ask them - we cannot help you, and would not if we could: We do not condone, support, or assist in the production of malicious code in any way, form, or manner. This is a professional site for professional developers.
 
Share this answer
 
Comments
Richard MacCutchan 10-Nov-16 5:30am    
This is a professional site for professional developers.
I thought it was a local shop, for local people. :)
OriginalGriff 10-Nov-16 5:55am    
There's nothing for you here. ;)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900