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 입력에 대 한 멀티 트라이드 모드에서 호출하지 않습니다.