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

目的地流,必须写作。

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.
 中文