Class SevenZipArchiveEntry
名称: Aspose.Zip.SevenZip 組み合わせ: Aspose.Zip.dll (25.5.0)
単一ファイルを7zアーカイブに表示します。
public abstract class SevenZipArchiveEntry : IArchiveFileEntry
Inheritance
Derived
SevenZipArchiveEntryEncrypted , SevenZipArchiveEntryPlain
Implements
相続人
object.GetType() , object.MemberwiseClone() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()
Remarks
Aspose.Zip.SevenZip.SevenZipArchiveEntry を Aspose.Zip.SevenZip.SevenZipArchiveEntry に挿入して、入力が暗号化されているかどうかを確認します。
Properties
CompressedSize
圧縮されたファイルのサイズが表示されます。
public ulong CompressedSize { get; }
不動産価値
CompressionSettings
圧縮または圧縮のための設定を取得します。
public SevenZipCompressionSettings CompressionSettings { get; }
不動産価値
FileAttributes
ホストシステムからファイル属性を取得します。
protected FileAttributes FileAttributes { get; }
不動産価値
IsDirectory
入力がディレクトリであるかどうかを示す値を得る。
public bool IsDirectory { get; }
不動産価値
ModificationTime
最後に変更された日付と時間が表示されます。
public DateTime ModificationTime { get; }
不動産価値
Name
アーカイブ内の入力の名前を入力します。
public string Name { get; protected set; }
不動産価値
Source
入力のためのデータソースストリームを取得します。
protected Stream Source { get; }
不動産価値
UncompressedSize
オリジナルファイルのサイズを取得します。
public ulong UncompressedSize { get; }
不動産価値
Methods
Extract(ストリップ、ストリップ)
ファイルシステムへの入り口を提供されたルートで抽出します。
public FileInfo Extract(string path, string password = null)
Parameters
path
string
ターゲットファイルへのルート. ファイルが既に存在している場合、それは過剰に書かれます。
password
string
暗号化のための選択肢パスワード
Returns
複合ファイルのファイル情報
Examples
using (var archive = new SevenZipArchive("archive.7z"))
{
archive.Entries[0].Extract("data.bin");
}
Exceptions
path’ is null.
通話者には、必要なアクセス許可はありません。
path’ は空っぽで、白いスペースのみが含まれ、または無効な文字が含まれています。
path" ファイルへのアクセスは拒否されます。
指定された path’, ファイル名, または両方ともシステム定義の最大長さを超えています. たとえば、Windows ベースのプラットフォームでは、パスは 248 文字未満で、ファイル名は 260 文字未満でなければなりません。
path’ のファイルには、列の真ん中のコロン(:)が含まれています。
アーカイブが腐敗した。
Extract(ストリーム、ストリーム)
提供された流れへの入り口を抽出します。
public void Extract(Stream destination, string password = null)
Parameters
destination
Stream
目的地の流れは、書くべきです。
password
string
暗号化のための選択肢パスワード
Examples
パスワードでZIPアーカイブの入力を抽出します。
using (var archive = new SevenZipArchive("archive.7z"))
{
archive.Entries[0].Extract(httpResponseStream);
}
Exceptions
destination’ does not support writing.
アーカイブは抽出のために開かれていません. - または - このエントリーはディレクトリです。
入り口内のデータが間違っています。
FinalizeCompressedData(ストリーム、バイト[])
圧縮されたデータに従うすべてのタイトルを出力ストリームに書く。
protected abstract int FinalizeCompressedData(Stream outputStream, byte[] encoderProperties)
Parameters
outputStream
Stream
入り口への出力流。
encoderProperties
byte
( )
コンプレッサーの特性
Returns
重要なデータブロックを入力した後に追加された「技術的な」バイトの数。
GetDestinationStream(Stream)
入り口の目的地の流れは、装飾されることができます。
protected abstract Stream GetDestinationStream(Stream outputStream)
Parameters
outputStream
Stream
入り口への出力流。
Returns
入力圧縮の目的地流。
Open(ストレッチ)
抽出のためのエントリーを開き、エントリーコンテンツの流れを提供します。
public Stream Open(string password = null)
Parameters
password
string
暗号化のための選択肢パスワード
Returns
入力の内容を表す流れ。
Examples
使用:Stream decompressed = entry.Open();
.NET 4.0 またはそれ以上 - Stream.CopyTo 方法を使用する:decompressed.CopyTo(httpResponse.OutputStream)
.NET 3.5 および以前 - バイトを手動でコピーする:
byte[] buffer = new byte[8192];
int bytesRead;
while (0 < (bytesRead = decompressed.Read(buffer, 0, buffer.Length)))
fileStream.Write(buffer, 0, bytesRead);
```</p>
#### Remarks
Read from the stream to get the original content of a file. See examples section.
#### Exceptions
[InvalidOperationException](https://learn.microsoft.com/dotnet/api/system.invalidoperationexception)
The archive is not opened for extraction. - or - This entry is a directory.
[InvalidDataException](https://learn.microsoft.com/dotnet/api/system.io.invaliddataexception)
Wrong data within the entry.
### <a id="Aspose_Zip_SevenZip_SevenZipArchiveEntry_CompressionProgressed"></a> CompressionProgressed
Raises when a portion of raw stream compressed.
```csharp
public event EventHandler<progresseventargs> CompressionProgressed
イベントタイプ
EventHandler < ProgressEventArgs >
Examples
archive.Entries[0].CompressionProgressed += (s, e) => { int percent = (int)((100 * (long)e.ProceededBytes) / entrySourceStream.Length); };
Remarks
イベント送信は Aspose.Zip.SevenZip.SevenZipArchiveEntry 例です。 LZMA2 エントリーのための多重モードでの呼びかけはありません。