Class RarArchiveLoadOptions
Class RarArchiveLoadOptions
Namespace: Aspose.Zip.Rar
Assembly: Aspose.Zip.dll (25.1.0)
אפשרויות בהן Aspose.Zip.Rar.RarArchive נטען מקובץ דחוס.
public class RarArchiveLoadOptions
ירושה
object ← RarArchiveLoadOptions
חברים המורשים
object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
בונים
RarArchiveLoadOptions()
public RarArchiveLoadOptions()
מאפיינים
DecryptionPassword
מניח או קובע את הסיסמה לפענוח פריטים ושמות פריטים.
public string DecryptionPassword { get; set; }
ערך המאפיין
דוגמאות
אתה יכול לספק סיסמת פענוח פעם אחת במהלך חילוץ הארכיון.
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);
}
}
}
}