By the look of the source code of SevenZSharp, it does not support password protected files.
Here's something else that might help you from codeplex. It seem to have an interface called ICryptoGetTextPassword
that you might be able to use if the 7z is password protected.
Edit
With a bit further look at SevenZipSharp it seems that it should support password protected archives accroding to their project page ( http://sevenzipsharp.codeplex.com/ ):
- Encryption and passwords are supported.
You need to download the latest code from Codeplex and build it yourself, in it you will have a class called SevenZipExtractor
where you have the following constructor:
/// <summary>
/// Initializes a new instance of SevenZipExtractor class.
/// </summary>
/// <param name="archiveFullName">The archive full file name.</param>
/// <param name="password">Password for an encrypted archive.</param>
public SevenZipExtractor(string archiveFullName, string password)
: base(password)
{
Init(archiveFullName);
}
Note this is not the same as Seven7Sharp, this is SevenZipSharp, but it works with 7z
.