Class WimFileEntry

Class WimFileEntry

ชื่อพื้นที่: Aspose.Zip.Wim การประกอบ: Aspose.Zip.dll (25.5.0)

แสดงไฟล์เดียวภายในไฟล์ wim

public sealed class WimFileEntry : WimEntry, IArchiveFileEntry

Inheritance

object WimEntry WimFileEntry

Implements

IArchiveFileEntry

อนุญาโตตุลาการ

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

รับความยาวของการเข้าสู่ระบบในไบต์

public long Length { get; }

คุณสมบัติมูลค่า

long

Methods

Extract(รั้ว)

นําเข้าสู่ระบบไฟล์โดยเส้นทางที่ให้

public FileInfo Extract(string path)

Parameters

path string

เส้นทางไปยังไฟล์เป้าหมาย หากไฟล์มีอยู่แล้วมันจะถูกเขียนเกินไป

Returns

FileInfo

ข้อมูลไฟล์ของไฟล์ประกอบ

Examples

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

Exceptions

ArgumentNullException

path’ is null.

SecurityException

ผู้โทรไม่ได้รับอนุญาตให้เข้าถึง

ArgumentException

path" เป็นที่ว่างเปล่ามีพื้นที่สีขาวเท่านั้นหรือมีตัวอักษรที่ไม่ถูกต้อง

UnauthorizedAccessException

การเข้าถึงไฟล์ path" ถูกปฏิเสธ

PathTooLongException

ระบุ path’, ชื่อไฟล์, หรือทั้งสองเกินความยาวสูงสุดที่กําหนดโดยระบบ ตัวอย่างเช่นบนแพลตฟอร์มที่ใช้ Windows, เส้นทางจะต้องน้อยกว่า 248 หมายเลขและชื่อไฟล์จะต้องน้อยกว่า 260 หมายเลข

NotSupportedException

ไฟล์ใน path" มีคอลัมน์ (:) ในส่วนกลางของเส้น

FileNotFoundException

ไฟล์ไม่ได้พบ

DirectoryNotFoundException

เส้นทางที่ระบุไม่ถูกต้องเช่นอยู่บนไดรฟ์ที่ไม่มีแผนที่

IOException

ไฟล์นี้เปิดแล้ว

InvalidDataException

ไฟล์นี้ถูกทําลาย

Extract(Stream)

นําเข้าสู่การไหลที่ให้

public void Extract(Stream destination)

Parameters

destination Stream

จุดหมายปลายทาง Stream. ต้องการเขียนได้

Examples

extract entry ของ 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

ไฟล์นี้ถูกทําลาย

Open()

เปิดป้อนสําหรับการสกัดและให้การไหลที่มีเนื้อหาป้อน

public Stream Open()

Returns

Stream

กระแสที่แสดงให้เห็นถึงเนื้อหาของป้อน

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.
 แบบไทย