SevenZipAESEncryptionSettings.SevenZipAESEncryptionSettings

SevenZipAESEncryptionSettings(string)

初始化一个新的实例SevenZipAESEncryptionSettings类.

public SevenZipAESEncryptionSettings(string password)
范围类型描述
passwordString用于加密或解密的密码。

例子

using (var archive = new SevenZipArchive(new SevenZipEntrySettings(null, new SevenZipAESEncryptionSettings("p@s$"))))
{
   archive.CreateEntry("data.bin", "data.bin");
   archive.Save("archive.7z");
}

也可以看看


SevenZipAESEncryptionSettings(SevenZipCipher)

初始化一个新的实例SevenZipAESEncryptionSettings带有外部密码的类.

public SevenZipAESEncryptionSettings(SevenZipCipher cipher)
范围类型描述
cipherSevenZipCipher自定义 AES 实现。

例子

SevenZipCipher cipher = ComposeMyCipher();
using (var archive = new SevenZipArchive(new SevenZipEntrySettings(null, new SevenZipAESEncryptionSettings(cipher))))
{
   archive.CreateEntry("data.bin", "data.bin");
   archive.Save("archive.7z");
}

也可以看看