Class ArchiveLoadOptions
Class ArchiveLoadOptions
Namespace: Aspose.Zip
Assembly: Aspose.Zip.dll (25.1.0)
圧縮ファイルからアーカイブを読み込むためのオプション。
public class ArchiveLoadOptions
継承
継承されたメンバー
object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
コンストラクター
ArchiveLoadOptions()
public ArchiveLoadOptions()
プロパティ
DecryptionPassword
エントリを復号化するためのパスワードを取得または設定します。
public string DecryptionPassword { get; set; }
プロパティ値
例
アーカイブの抽出時に一度だけ復号化パスワードを提供できます。
using (FileStream fs = File.OpenRead("encrypted_archive.zip"))
{
using (var extracted = File.Create("extracted.bin"))
{
using (Archive archive = new Archive(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);
}
}
}
}
参照
Encoding
エントリ名のエンコーディングを取得または設定します。
public Encoding Encoding { get; set; }
プロパティ値
例
zipファイルのプロパティに関係なく、指定されたエンコーディングを使用して構成されたエントリ名。
using (FileStream fs = File.OpenRead("archive.zip"))
{
using (Archive archive = new Archive(fs, new ArchiveLoadOptions() { Encoding = System.Text.Encoding.GetEncoding(932) }))
{
string name = archive.Entries[0].Name;
}
}
EntryExtractionProgressed
いくつかのバイトが抽出されたときに呼び出されるデリゲートを取得または設定します。
public EventHandler<progresseventargs> EntryExtractionProgressed { get; set; }
プロパティ値
EventHandler<ProgressEventArgs>
例
Archive archive = new Archive("archive.zip",
new ArchiveLoadOptions() { EntryExtractionProgressed = (s, e) => { int percent = (int)((100 * e.ProceededBytes) / ((ArchiveEntry)s).UncompressedSize); } })
備考
イベントの送信者は、進行中の抽出を持つAspose.Zip.ArchiveEntryインスタンスです。
EntryListed
目次内にエントリがリストされたときに呼び出されるデリゲートを取得または設定します。
public EventHandler<entryeventargs> EntryListed { get; set; }
プロパティ値
EventHandler<EntryEventArgs>
例
Archive archive = new Archive("archive.zip", new ArchiveLoadOptions() { EntryListed = (s, e) => { Console.WriteLine(e.Entry.Name); } });