Class ArchiveFormatDetector

Class ArchiveFormatDetector

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

检测归档格式并提供其他相关信息。

[Obsolete("请改用 ArchiveInstanceInfo 类的静态方法。")]
public sealed class ArchiveFormatDetector

继承

objectArchiveFormatDetector

继承成员

object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

构造函数

ArchiveFormatDetector()

初始化 Aspose.Zip.ArchiveInfo.ArchiveFormatDetector 类的新实例。

[Obsolete("请改用 ArchiveInstanceInfo 类的静态方法。")]
public ArchiveFormatDetector()

方法

GetFormatInfo(string)

获取格式信息。

[Obsolete("请改用 ArchiveInstanceInfo 类的静态方法。")]
public ArchiveFormatInfo GetFormatInfo(string fileName)

参数

fileName string

归档文件的文件名。

返回

ArchiveFormatInfo

有关归档格式的信息,如果未检测到格式,则返回 null。

异常

ArgumentNullException

fileName 为 null。

SecurityException

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

ArgumentException

fileName 为空、仅包含空格或包含无效字符。

UnauthorizedAccessException

访问文件 fileName 被拒绝。

PathTooLongException

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

NotSupportedException

fileName 中间包含冒号 (:)。

IOException

打开文件时发生 I/O 错误。

GetFormatInfo(Stream)

获取格式信息。

[Obsolete("请改用 ArchiveInstanceInfo 类的静态方法。")]
public ArchiveFormatInfo GetFormatInfo(Stream stream)

参数

stream Stream

归档文件的流。

返回

ArchiveFormatInfo

有关归档格式的信息,如果未检测到格式,则返回 null。

异常

ArgumentNullException

stream 为 null。

ArgumentException

stream 不是可寻址的。

 中文