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);
}
}
}
}