Class RarArchiveLoadOptions
Class RarArchiveLoadOptions
名称: Aspose.Zip.Rar 收藏: Aspose.Zip.dll (25.5.0)
使用 Aspose.Zip.Rar. RarArchive 从压缩文件上传的选项。
public class RarArchiveLoadOptions
Inheritance
object ← RarArchiveLoadOptions
继承人
object.GetType() , object.MemberwiseClone() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()
Constructors
RarArchiveLoadOptions()
public RarArchiveLoadOptions()
Properties
DecryptionPassword
收到或设置密码来解密输入和输入名称。
public string DecryptionPassword { get; set; }
财产价值
Examples
您可以在存档提取时提供解密密码。
using (FileStream fs = File.OpenRead("encrypted_archive.rar"))
{
using (var extracted = File.Create("extracted.bin"))
{
using (RarArchive archive = new RarArchive(fs, new ArchiveLoadOptions() { DecryptionPassword = "p@s$" }))
{
using (var decompressed = archive.Entries[0].Open())
{
byte[] b = new byte[8192];
int bytesRead;
while (0 < (bytesRead = decompressed.Read(b, 0, b.Length)))
extracted.Write(b, 0, bytesRead);
}
}
}
}
看也
RarArchiveEntry . Open ( string )