Class RarArchiveLoadOptions
Class RarArchiveLoadOptions
Nazwa przestrzeń: Aspose.Zip.Rar Zestawienie: Aspose.Zip.dll (25.5.0)
Opcje, z którymi Aspose.Zip.Rar. RarArchive jest pobierany z kompresyjnego pliku.
public class RarArchiveLoadOptions
Inheritance
object ← RarArchiveLoadOptions
Dziedziczeni członkowie
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
Otrzymuje lub ustawia hasło do dekrypcji wpisów i nazw wpisów.
public string DecryptionPassword { get; set; }
Wartość nieruchomości
Examples
Możesz podać hasło dekrypcji raz na ekstrakcji archiwum.
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);
}
}
}
}
Zobacz również
RarArchiveEntry . Open ( string )