Class XarDirectoryEntry

Class XarDirectoryEntry

Namespace: Aspose.Zip.Xar
Assembly: Aspose.Zip.dll (25.1.0)

表示 xar 压缩文件中的目录条目。

public sealed class XarDirectoryEntry : XarEntry

继承

objectXarEntryXarDirectoryEntry

继承成员

XarEntry.ToString(), XarEntry.Name, XarEntry.FullPath, XarEntry.IsDirectory, XarEntry.Parent, XarEntry.CreationTime, XarEntry.LastAccessTime, XarEntry.LastWriteTime, object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

属性

AllEntries

获取构成目录的所有 Aspose.Zip.Xar.XarEntry 类型的条目(递归)。

public IEnumerable<xarentry> AllEntries { get; }

属性值

IEnumerable<XarEntry&gt;

Directories

获取构成目录的 Aspose.Zip.Xar.XarDirectoryEntry 类型的条目。

public IEnumerable<xardirectoryentry> Directories { get; }

属性值

IEnumerable<XarDirectoryEntry&gt;

Files

获取构成目录的 Aspose.Zip.Xar.XarFileEntry 类型的条目。

public IEnumerable<xarfileentry> Files { get; }

属性值

IEnumerable<XarFileEntry&gt;

FilesAndDirectories

获取构成目录的 Aspose.Zip.Xar.XarEntry 类型的条目。

public IEnumerable<xarentry> FilesAndDirectories { get; }

属性值

IEnumerable<XarEntry&gt;

方法

ExtractToDirectory(string)

将当前目录中的所有文件提取到提供的目录中。

public void ExtractToDirectory(string destinationDirectory)

参数

destinationDirectory string

要放置提取文件的目录路径。

示例

using (var archive = new XarArchive("archive.xar")) 
{
   ((XarDirectoryEntry)archive.Entries[0]).ExtractToDirectory("C:\\extracted");
}

备注

如果目录不存在,将会创建它。

异常

ArgumentNullException

路径为 null

PathTooLongException

指定的路径、文件名或两者都超过系统定义的最大长度。例如,在基于 Windows 的平台上,路径必须少于 248 个字符,文件名必须少于 260 个字符。

SecurityException

调用者没有访问现有目录所需的权限。

NotSupportedException

如果目录不存在,路径包含非驱动器标签(“C:\”)部分的冒号字符(:)。

ArgumentException

路径是零长度字符串,仅包含空格或包含一个或多个无效字符。可以使用 System.IO.Path.GetInvalidPathChars 方法查询无效字符。-或-路径以冒号字符(:)为前缀,或仅包含冒号字符(:)。

IOException

路径指定的目录是一个文件。-或-网络名称未知。

InvalidDataException

压缩文件已损坏。

 中文