Class IsoArchive

Class IsoArchive

名称: Aspose.Zip.Iso 收藏: Aspose.Zip.dll (25.5.0)

代表ISO档案(ISO 9660)。

public sealed class IsoArchive : IArchive, IDisposable

Inheritance

object IsoArchive

Implements

IArchive , IDisposable

继承人

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

Constructors

IsoArchive()

启动 Aspose.Zip.Iso.IsoArchive 类的新例子,并创建一个空白的 ISO 档案添加新文件和目录。

public IsoArchive()

Examples

下面的例子显示如何创建一个新的空的ISO档案,并将文件添加到它:

// Create a new empty ISO archive
using(IsoArchive isoArchive = new IsoArchive())
{
    // Add files to the ISO archive
    isoArchive.CreateEntry("example_file.txt", "path_to_file.txt");

    // Save the ISO archive to a file
    isoArchive.Save("new_archive.iso");
}

IsoArchive(流量, IsoLoadOptions)

启动 Aspose.Zip.Iso.ISO档案类的新例子,并创建一个可以从文件中提取的输入列表。

public IsoArchive(Stream sourceStream, IsoLoadOptions loadOptions = null)

Parameters

sourceStream Stream

資料來源:必須可搜尋。

loadOptions IsoLoadOptions

与存档加载的选项。

Examples

下面的示例显示如何将所有输入提取到一个目录。

using (var archive = new IsoArchive(File.OpenRead("archive.iso")))
{ 
   archive.ExtractToDirectory("C:\\extracted");
}

Remarks

这个制造商不会排除任何输入。

Exceptions

ArgumentNullException

sourceStream’ is null.

ArgumentException

sourceStream’ is not seekable.

InvalidDataException

sourceStream’ is not a valid ISO archive.

IsoArchive(字符串, IsoLoadOptions)

启动 Aspose.Zip.Iso.ISO档案类的新例子,并创建一个可以从文件中提取的输入列表。

public IsoArchive(string path, IsoLoadOptions loadOptions = null)

Parameters

path string

走向档案的路径。

loadOptions IsoLoadOptions

与存档加载的选项。

Examples

下面的示例显示如何将所有输入提取到一个目录。

using (var archive = new IsoArchive("archive.iso")) 
{ 
   archive.ExtractToDirectory("C:\\extracted");
}

Remarks

这个制造商不会排除任何输入。

Exceptions

ArgumentNullException

path’ is null.

SecurityException

召唤者没有所需的访问许可。

ArgumentException

path’ 是空的,只包含白色空间,或包含无效的字符。

UnauthorizedAccessException

拒绝访问 path" 文件。

PathTooLongException

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

NotSupportedException

文件在 path’ 中间包含一个列(:)。

FileNotFoundException

文件未找到。

DirectoryNotFoundException

指定的路径是无效的,例如在无地图驱动器上。

IOException

文件已经开放了。

EndOfStreamException

文件太短了。

Properties

Entries

收到 Aspose.Zip.Iso.IsoEntry 类型的输入,构成档案。

public ReadOnlyCollection<isoentry> Entries { get; }

财产价值

ReadOnlyCollection < IsoEntry >

Methods

CreateDirectory(线条)

将目录添加到ISO图像中。

public IsoEntry CreateDirectory(string name)

Parameters

name string

路径的目录在ISO。

Returns

IsoEntry

ISO输入组成。

Exceptions

InvalidOperationException

该档案已开放用于提取。

ArgumentNullException

“名称”是零或空。

CreateEntry(字符串, string)

将文件添加到ISO图像中。

public IsoEntry CreateEntry(string name, string filePath)

Parameters

name string

文件的路径在ISO。

filePath string

文件的路径。

Returns

IsoEntry

ISO输入组成。

Exceptions

ArgumentNullException

filePath’ 是零。

ArgumentException

filePath’ 是空的,只包含白色空间,或包含无效的字符。

UnauthorizedAccessException

拒绝访问 filePath’ 文件。

PathTooLongException

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

NotSupportedException

文件在 filePath’ 中间包含一个列(:)。

IOException

在打开文件时出现了 I/O 错误。

CreateEntry(流,流)

将文件添加到ISO图像中。

public IsoEntry CreateEntry(string name, Stream source)

Parameters

name string

文件的路径在ISO。

source Stream

包含文件数据的流量。

Returns

IsoEntry

ISO输入组成。

CreateEntry(线条)

将文件添加到ISO图像中。

public IsoEntry CreateEntry(string name)

Parameters

name string

路径的目录在ISO。

Returns

IsoEntry

ISO输入组成。

Exceptions

ArgumentNullException

“名称”是零或空。

InvalidOperationException

该档案已开放用于提取。

Dispose()

执行与释放、释放或重新管理未管理资源相关的应用定义任务。

public void Dispose()

ExtractToDirectory(线条)

将所有输入输入到指定的目录中。

public void ExtractToDirectory(string destinationDirectory)

Parameters

destinationDirectory string

该目录将输入到。

Examples

下面的例子显示如何将所有输入提取到一个目录:

using (var archive = new IsoArchive(File.OpenRead("archive.iso")))
{ 
   archive.ExtractToDirectory("C:\\extracted");
}

Exceptions

InvalidOperationException

当档案在编辑模式下时。

ArgumentNullException

destinationDirectory’ 為 null 時。

Save(字符串, IsoSaveOptions)

将 ISO 图像存储到指定的路径。

public void Save(string path, IsoSaveOptions saveOptions = null)

Parameters

path string

路径,在那里ISO图像将被保存。

saveOptions IsoSaveOptions

存储ISO档案的选项。

Examples

下面的例子显示如何将ISO档案存储到文件中:

// Create a new empty ISO archive
using(IsoArchive isoArchive = new IsoArchive())
{
    // Add files to the ISO archive
    isoArchive.CreateEntry("example_file.txt", "path_to_file.txt");

    // Save the ISO archive to a file
    isoArchive.Save("new_archive.iso");
}

Exceptions

InvalidOperationException

当档案不在编辑模式时。

ArgumentNullException

path’ 為 null 時,轉動。

DirectoryNotFoundException

当指定的路径是无效的时,如在无地图驱动器上。

IOException

当文件已经打开时。

UnauthorizedAccessException

当访问 path" 文件时被拒绝。

PathTooLongException

当指定的 path’ 超过系统定义的最大长度时,旋转。

Save(流量, IsoSaveOptions)

将 ISO 图像存储到指定的流。

public void Save(Stream stream, IsoSaveOptions saveOptions = null)

Parameters

stream Stream

流的ISO图像将被保存。

saveOptions IsoSaveOptions

存储ISO档案的选项。

Examples

下面的例子表明如何将ISO档案存储到内存流中:

// Create a new empty ISO archive
using(IsoArchive isoArchive = new IsoArchive())
{
    // Add files to the ISO archive
    isoArchive.CreateEntry("example_file.txt", "path_to_file.txt");

    // Save the ISO archive to a memory stream
    isoArchive.Save(memoryStream);
}

Exceptions

InvalidOperationException

当档案不在编辑模式时。

ArgumentNullException

stream’ 為 null 時。

ArgumentException

stream’ 不可寫的時。

 中文