Class WimFileEntry

Class WimFileEntry

Tên không gian: Aspose.Zip.Wim Tổng hợp: Aspose.Zip.dll (25.5.0)

Hiển thị một tập tin duy nhất trong file wim.

public sealed class WimFileEntry : WimEntry, IArchiveFileEntry

Inheritance

object WimEntry WimFileEntry

Implements

IArchiveFileEntry

Thành viên thừa kế

WimEntry.ToString() , WimEntry.Archive , WimEntry.Image , WimEntry.Parent , WimEntry.Name , WimEntry.ShortName , WimEntry.FullPath , WimEntry.ChangeTime , WimEntry.CreationTime , WimEntry.LastAccessTime , WimEntry.LastWriteTime , WimEntry.ModificationTime , WimEntry.FileAttributes , WimEntry.AlternateDataStreams , WimEntry.HardLink , WimEntry.HasHardLinks , WimEntry.IsDirectory , object.GetType() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()

Properties

Length

Có được chiều dài vào trong byte.

public long Length { get; }

Giá trị bất động sản

long

Methods

Extract(String)

Xét nhập vào hệ thống tệp theo con đường được cung cấp.

public FileInfo Extract(string path)

Parameters

path string

Đường đến tập tin đích. nếu tập tin đã tồn tại, nó sẽ được viết quá.

Returns

FileInfo

Thông tin file của file composed.

Examples

using (var archive = new WimArchive("archive.wim"))
{
    archive.Images[0].RootDirectory.Files[0].Extract("data.bin");
}

Exceptions

ArgumentNullException

path’ is null.

SecurityException

Người gọi không có giấy phép cần thiết để truy cập.

ArgumentException

Đường path’ là trống, chỉ chứa các không gian trắng, hoặc chứa các ký tự vô hiệu.

UnauthorizedAccessException

Truy cập vào tệp path" bị từ chối.

PathTooLongException

Lối đi path", tên tệp, hoặc cả hai vượt quá chiều dài tối đa được xác định bởi hệ thống. Ví dụ, trên nền tảng dựa trên Windows, các con đường phải nhỏ hơn 248 ký tự, và tên tệp phải nhỏ hơn 260 ký tự.

NotSupportedException

Tệp ở path’ chứa một cột (:) ở giữa dòng.

FileNotFoundException

file không được tìm thấy.

DirectoryNotFoundException

Con đường được chỉ định là vô hiệu, chẳng hạn như ở trên một ổ đĩa không được vẽ.

IOException

Tệp đã mở rồi.

InvalidDataException

Tài liệu đã bị phá hủy.

Extract(Stream)

Thu thập nhập vào dòng cung cấp.

public void Extract(Stream destination)

Parameters

destination Stream

Destination stream. phải được viết.

Examples

Nhập một bài đăng từ WIM Archive.

using (var archive = new WimArchive("archive.wim"))
{
    archive.Images[0].RootDirectory.Files[0].Extract(httpResponseStream);
}

Exceptions

ArgumentException

destination’ does not support writing.

InvalidDataException

Tài liệu đã bị phá hủy.

Open()

Mở vào để khai thác và cung cấp một dòng với nội dung nhập.

public Stream Open()

Returns

Stream

dòng mà đại diện cho nội dung của bài đăng.

Examples

Sử dụng :Stream decompressed = entry.Open();

.NET 4.0 và cao hơn - sử dụng phương pháp Stream.CopyTo:decompressed.CopyTo(httpResponse.OutputStream)

.NET 3.5 và trước - sao chép byte bằng tay:

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.
 Tiếng Việt