Class CabEntry
名称: Aspose.Zip.Cab 組み合わせ: Aspose.Zip.dll (25.5.0)
キャブアーカイブ内の単一ファイルを表します。
public sealed class CabEntry : IArchiveFileEntry
Inheritance
Implements
相続人
object.GetType() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()
Properties
Length
バイトで入力の長さを取得します。
public uint Length { get; }
不動産価値
ModificationTime
最後に変更された日付と時間が表示されます。
public DateTime ModificationTime { get; }
不動産価値
Name
アーカイブ内の入力の名前を入力します。
public string Name { get; }
不動産価値
Methods
Extract(ストレッチ)
ファイルシステムへの入り口を提供されたルートで抽出します。
public FileInfo Extract(string path)
Parameters
path
string
ターゲットファイルへのルート. ファイルが既に存在している場合、それは過剰に書かれます。
Returns
複合ファイルのファイル情報
Examples
using (var archive = new CabArchive("archive.cab"))
{
archive.Entries[0].Extract("data.bin");
}
Exceptions
path’ is null.
通話者には、必要なアクセス許可はありません。
path’ は空っぽで、白いスペースのみが含まれ、または無効な文字が含まれています。
path" ファイルへのアクセスは拒否されます。
指定された path’, ファイル名, または両方ともシステム定義の最大長さを超えています. たとえば、Windows ベースのプラットフォームでは、パスは 248 文字未満で、ファイル名は 260 文字未満でなければなりません。
path’ のファイルには、列の真ん中のコロン(:)が含まれています。
ファイルは見つかりません。
指定されたルートは無効です、例えば、マッピングされていないドライブにあります。
ファイルはすでに開いています。
ストリームイニシアチブは、誤ったデータのために失敗しました。
アーカイブが腐敗した。
Extract(Stream)
提供された流れへの入り口を抽出します。
public void Extract(Stream destination)
Parameters
destination
Stream
目的地の流れは、書くべきです。
Examples
キャブアーカイブの入力を抽出します。
Using (var archive = new CabArchive("archive.cab"))
{
archive.Entries[0].Extract(httpResponseStream);
}
Exceptions
destination’ does not support writing.
ストリームイニシアチブは、誤ったデータのために失敗しました。
アーカイブが腐敗した。
Open()
抽出のためのエントリーを開き、エントリーコンテンツの流れを提供します。
public Stream Open()
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
[NotSupportedException](https://learn.microsoft.com/dotnet/api/system.notsupportedexception)
Stream initialization failed due to wrong data.
[InvalidDataException](https://learn.microsoft.com/dotnet/api/system.io.invaliddataexception)
The archive is corrupted.
### <a id="Aspose_Zip_Cab_CabEntry_ToString"></a> ToString\(\)
```csharp
public override string ToString()