I'm currently trying to implement the SevenZipSharp
functionality into my project. I've read what documentation they have and checked out the source code for notes but I'm having trouble figuring out the CompressFilesEncrypted
method. I'm getting an error that says "Access is Denied" on the archiveName parameter.
Anyone that has used this successfully could you please give me some advice on how to complete this implementation?
Here is the code I'm using (seemed pretty simple):
string fileName = Path.GetFileName(filepath);
string outputDir = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
try
{
SevenZipCompressor compressor = new SevenZipCompressor();
compressor.CompressionMethod = CompressionMethod.Default;
compressor.CompressionLevel = CompressionLevel.Normal;
compressor.ZipEncryptionMethod = ZipEncryptionMethod.Aes256;
compressor.ArchiveFormat = OutArchiveFormat.Zip;
**compressor.CompressFilesEncrypted(outputDir, "12345",filepath);**
}
catch (Exception exc)
{
MessageBox.Show(exc.Message);
}
Any insight is much appreciated! I know someone has to have made this work before :)