I'm writing an window form similar to 7-Zip, my problem is in the extraction part, I don't know how to check if the archive I want to extract is password protected or not. Any idea?
Checking whether an archive is password-protected in Sevenzipsharp (C#)
1.4k views Asked by carryall At
2
There are 2 answers
0
On
It depends on the archive type. The ZIP specification describes how it's done for ZIP, although it's not very robust apparently.
I've got the solution: just check the extractor before extracting the archive:
Doing it this way the
fileExtractor.Check()
will befalse
, if the archive requires a password, and you're not providing the password for it or the password is not correct.