Class RarArchiveEntry
名称: Aspose.Zip.Rar 組み合わせ: Aspose.Zip.dll (25.5.0)
アーカイブ内の単一ファイルを表示します。
public abstract class RarArchiveEntry : IArchiveFileEntry
Inheritance
Derived
RarArchiveEntryEncrypted , RarArchiveEntryPlain
Implements
相続人
object.GetType() , object.MemberwiseClone() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()
Remarks
Aspose.Zip.Rar.RarArchiveEntry を Aspose.Zip.Rar.RarArchiveEntry に暗号化して、入力が暗号化されているかどうかを確認します。
Properties
CompressedSize
圧縮されたファイルのサイズが表示されます。
public ulong CompressedSize { get; }
不動産価値
CreationTime
創造の日付と時間。
public DateTime CreationTime { get; }
不動産価値
IsDirectory
入力がディレクトリであるかどうかを示す値を得る。
public bool IsDirectory { get; }
不動産価値
LastAccessTime
最後のアクセス日と時間を取得します。
public DateTime LastAccessTime { get; }
不動産価値
ModificationTime
最後に変更された日付と時間が表示されます。
public DateTime ModificationTime { get; }
不動産価値
Name
アーカイブ内の入力の名前を入力します。
public string Name { get; }
不動産価値
Source
入力のためのデータソースストリームを取得します。
protected Stream Source { get; set; }
不動産価値
UncompressedSize
オリジナルのファイルのサイズを取得します。
public ulong UncompressedSize { get; }
不動産価値
Methods
Extract(ストリップ、ストリップ)
ファイルシステムへの入り口を提供されたルートで抽出します。
public FileInfo Extract(string path, string password = null)
Parameters
path
string
ターゲットファイルへのルート. ファイルが既に存在している場合、それは過剰に書かれます。
password
string
暗号化のための選択肢パスワード
Returns
コンポーネントファイルの情報
Examples
珍しいアーカイブから2つのエントリーを抽出します。
using (FileStream rarFile = File.Open("archive.rar", FileMode.Open))
{
using (RarArchive archive = new RarArchive(rarFile))
{
archive.Entries[0].Extract("first.bin", "pass");
archive.Entries[1].Extract("second.bin", "pass");
}
}
Exceptions
path’ is null.
通話者には、必要なアクセス許可はありません。
path’ は空っぽで、白いスペースのみが含まれ、または無効な文字が含まれています。
path" ファイルへのアクセスは拒否されます。
指定された path’, ファイル名, または両方ともシステム定義の最大長さを超えています. たとえば、Windows ベースのプラットフォームでは、パスは 248 文字未満で、ファイル名は 260 文字未満でなければなりません。
path’ のファイルには、列の真ん中のコロン(:)が含まれています。
ファイルは見つかりません。
指定されたルートは無効です、例えば、マッピングされていないドライブにあります。
ファイルはすでに開いています。
データは腐敗しています. -or- CRC または MAC 検証は入力に失敗しました。
Extract(ストリーム、ストリーム)
提供された流れへの入り口を抽出します。
public void Extract(Stream destination, string password = null)
Parameters
destination
Stream
目的地の流れは、書くべきです。
password
string
暗号化のための選択肢パスワード
Examples
パスワードで珍しいアーカイブのエントリーを抽出します。
using (FileStream rarFile = File.Open("archive.zip", FileMode.Open))
{
using (RarArchive archive = new RarArchive(rarFile))
{
archive.Entries[0].Extract(httpResponseStream, "p@s$");
}
}
Exceptions
CRCまたはMAC検証は入力に失敗しました。
destination’ does not support writing.
データは腐敗しています. -or- CRC または MAC 検証は入力に失敗しました。
Open(ストレッチ)
抽出のためのエントリーを開き、デコンプレッシャーされたエントリーコンテンツの流れを提供します。
public Stream Open(string password = null)
Parameters
password
string
暗号化のためのオプションパスワード. それはまた Aspose.Zip.Rar.RarArchiveLoadOptions.DecryptionPassword に設定することができます。
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
<p>Read from the stream to get the original content of a file. See examples section.</p>
### <a id="Aspose_Zip_Rar_RarArchiveEntry_ExtractionProgressed"></a> ExtractionProgressed
Raises when a portion of raw stream extracted.
```csharp
public event EventHandler<progresseventargs> ExtractionProgressed
イベントタイプ
EventHandler < ProgressEventArgs >
Examples
archive.Entries[0].ExtractionProgressed += (s, e) => { int percent = (int)((100 * e.ProceededBytes) / ((RarArchiveEntry)s).UncompressedSize); };
Remarks
イベント送信は Aspose.Zip.Rar.RarArchiveEntry 例です。