Class RarArchiveLoadOptions
Class RarArchiveLoadOptions
Tên không gian: Aspose.Zip.Rar Tổng hợp: Aspose.Zip.dll (25.5.0)
Các tùy chọn mà Aspose.Zip.Rar.rarArchive được tải từ một tệp bị nén.
public class RarArchiveLoadOptions
Inheritance
object ← RarArchiveLoadOptions
Thành viên thừa kế
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
Nhận hoặc đặt mật khẩu để xóa nhập và tên nhập.
public string DecryptionPassword { get; set; }
Giá trị bất động sản
Examples
Bạn có thể cung cấp mật khẩu giải mã một lần trên lưu trữ.
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);
}
}
}
}
Xem thêm
RarArchiveEntry . Open ( string )