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

الطريق " فارغ ، يحتوي على مساحات بيضاء فقط ، أو يحتوي على أحرف غير صحيحة.

UnauthorizedAccessException

يتم رفض الوصول إلى ملف path".

PathTooLongException

على سبيل المثال ، على المنصات المستندة إلى Windows ، يجب أن تكون المسارات أقل من 248 حرفًا ، ويجب أن يكون اسم الملف أقل من 260 حرفًا.

NotSupportedException

ملف في path’ يحتوي على عمود (:) في وسط السلسلة.

FileNotFoundException

لم يتم العثور على الملف.

DirectoryNotFoundException

المسار المحدد غير صالح ، على سبيل المثال ، على محرك أقراص غير مسجلة.

IOException

الملف مفتوح بالفعل.

InvalidDataException

وقد تم تدمير الأرشيف

Extract(Stream)

إخراج الدخول إلى التدفق المقدم.

public void Extract(Stream destination)

Parameters

destination Stream

كلمات مفتاحية يجب أن تكون مكتوبة

Examples

استخراج إدخال من أرشيف wim.

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.
 عربي