Class RarArchiveLoadOptions
Class RarArchiveLoadOptions
Namespace: Aspose.Zip.Rar
Assembly: Aspose.Zip.dll (25.1.0)
Opzioni con cui Aspose.Zip.Rar.RarArchive viene caricato da un file compresso.
public class RarArchiveLoadOptions
Ereditarietà
object ← RarArchiveLoadOptions
Membri Ereditati
object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Costruttori
RarArchiveLoadOptions()
public RarArchiveLoadOptions()
Proprietà
DecryptionPassword
Ottiene o imposta la password per decrittografare le voci e i nomi delle voci.
public string DecryptionPassword { get; set; }
Valore della Proprietà
Esempi
Puoi fornire la password di decrittografia una sola volta durante l'estrazione dell'archivio.
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);
}
}
}
}