Class IsoArchive

Class IsoArchive

Tên không gian: Aspose.Zip.Iso Tổng hợp: Aspose.Zip.dll (25.5.0)

Nó đại diện cho một lưu trữ ISO (ISO 9660).

public sealed class IsoArchive : IArchive, IDisposable

Inheritance

object IsoArchive

Implements

IArchive , IDisposable

Thành viên thừa kế

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

Constructors

IsoArchive()

Bắt đầu một ví dụ mới của lớp Aspose.Zip.Iso.IsoArchive và tạo một lưu trữ ISO trốngđể thêm các tập tin và thư mục mới.

public IsoArchive()

Examples

Ví dụ sau đây cho thấy làm thế nào để tạo một tài liệu ISO trống mới và thêm tệp vào nó:

// 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(Stream, IsoLoadOptions)

Bắt đầu một ví dụ mới của lớp Aspose.Zip.Iso.IsoArchive và tạo ra một danh sách nhập mà có thể được rút ra từ lưu trữ.

public IsoArchive(Stream sourceStream, IsoLoadOptions loadOptions = null)

Parameters

sourceStream Stream

Nguồn gốc của tài liệu. nó phải được tìm kiếm.

loadOptions IsoLoadOptions

Các tùy chọn để tải file với.

Examples

Ví dụ sau đây cho thấy làm thế nào để rút tất cả các mục vào một thư mục.

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

Remarks

Nhà sản xuất này không loại bỏ bất kỳ đầu vào nào.

Exceptions

ArgumentNullException

sourceStream’ is null.

ArgumentException

sourceStream’ is not seekable.

InvalidDataException

sourceStream’ is not a valid ISO archive.

IsoArchive(Thẻ, IsoLoadOptions)

Bắt đầu một ví dụ mới của lớp Aspose.Zip.Iso.IsoArchive và tạo ra một danh sách nhập mà có thể được rút ra từ lưu trữ.

public IsoArchive(string path, IsoLoadOptions loadOptions = null)

Parameters

path string

Cách di chuyển đến file file.

loadOptions IsoLoadOptions

Các tùy chọn để tải file với.

Examples

Ví dụ sau đây cho thấy làm thế nào để rút tất cả các mục vào một thư mục.

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

Remarks

Nhà sản xuất này không loại bỏ bất kỳ đầu vào nào.

Exceptions

ArgumentNullException

path’ is null.

SecurityException

Người gọi không có giấy phép cần thiết để truy cập.

ArgumentException

Đường path’ là trống, chỉ chứa các không gian trắng, hoặc chứa các ký tự vô hiệu.

UnauthorizedAccessException

Truy cập vào tệp path" bị từ chối.

PathTooLongException

Lối đi path", tên tệp, hoặc cả hai vượt quá chiều dài tối đa được xác định bởi hệ thống. Ví dụ, trên nền tảng dựa trên Windows, các con đường phải nhỏ hơn 248 ký tự, và tên tệp phải nhỏ hơn 260 ký tự.

NotSupportedException

Tệp ở path’ chứa một cột (:) ở giữa dòng.

FileNotFoundException

file không được tìm thấy.

DirectoryNotFoundException

Con đường được chỉ định là vô hiệu, chẳng hạn như ở trên một ổ đĩa không được vẽ.

IOException

Tệp đã mở rồi.

EndOfStreamException

file quá ngắn.

Properties

Entries

Gets entries of Aspose.Zip.Iso.IsoEntry type constituting the archive.

public ReadOnlyCollection<isoentry> Entries { get; }

Giá trị bất động sản

ReadOnlyCollection < IsoEntry >

Methods

CreateDirectory(String)

Thêm một thư mục vào hình ảnh ISO.

public IsoEntry CreateDirectory(string name)

Parameters

name string

Hướng dẫn hướng dẫn trong ISO.

Returns

IsoEntry

ISO entry được thành lập.

Exceptions

InvalidOperationException

Tài liệu được mở để khai thác.

ArgumentNullException

“Tên” là không hoặc trống.

CreateEntry(Thẻ, string)

Thêm một tập tin vào hình ảnh ISO.

public IsoEntry CreateEntry(string name, string filePath)

Parameters

name string

Hướng dẫn của file trong ISO.

filePath string

Con đường của file.

Returns

IsoEntry

ISO entry được thành lập.

Exceptions

ArgumentNullException

filePath’ là null.

ArgumentException

filePath’ là trống, chỉ chứa không gian trắng, hoặc chứa các ký tự vô hiệu.

UnauthorizedAccessException

Truy cập vào tệp filePath’ bị từ chối.

PathTooLongException

Ví dụ, trên các nền tảng dựa trên Windows, các con đường phải nhỏ hơn 248 ký tự, và tên tập tin phải nhỏ hơn 260 ký tự.

NotSupportedException

File tại filePath’ chứa một cột (:) ở giữa dòng.

IOException

Một lỗi I/O xảy ra trong khi mở tệp.

CreateEntry(Stream , Stream)

Thêm một tập tin vào hình ảnh ISO.

public IsoEntry CreateEntry(string name, Stream source)

Parameters

name string

Hướng dẫn của file trong ISO.

source Stream

Stream chứa dữ liệu tập tin.

Returns

IsoEntry

ISO entry được thành lập.

CreateEntry(String)

Thêm một tập tin vào hình ảnh ISO.

public IsoEntry CreateEntry(string name)

Parameters

name string

Hướng dẫn hướng dẫn trong ISO.

Returns

IsoEntry

ISO entry được thành lập.

Exceptions

ArgumentNullException

“Tên” là không hoặc trống.

InvalidOperationException

Tài liệu được mở để khai thác.

Dispose()

Thực hiện các nhiệm vụ được xác định theo ứng dụng liên quan đến việc giải phóng, giải phóng hoặc tái quản lý các tài nguyên không được quản lý.

public void Dispose()

ExtractToDirectory(String)

Thu thập tất cả các bài đăng vào thư mục cụ thể.

public void ExtractToDirectory(string destinationDirectory)

Parameters

destinationDirectory string

Danh mục để rút các bài đăng đến.

Examples

Ví dụ sau đây cho thấy làm thế nào để rút tất cả các bài đăng vào một thư mục:

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

Exceptions

InvalidOperationException

Thrown khi lưu trữ đang trong chế độ chỉnh sửa.

ArgumentNullException

Thrown khi destinationDirectory’ là null.

Save(Thẻ, IsoSaveOptions)

Tiết kiệm hình ảnh ISO đến con đường được chỉ định.

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

Parameters

path string

Con đường nơi hình ảnh ISO sẽ được tiết kiệm.

saveOptions IsoSaveOptions

Các tùy chọn để lưu ISO lưu trữ với.

Examples

Ví dụ sau đây cho thấy cách lưu một lưu trữ ISO vào một tệp:

// 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

Thrown khi lưu trữ không ở chế độ chỉnh sửa.

ArgumentNullException

Thrown khi path’ là null.

DirectoryNotFoundException

Thâm vào khi con đường được chỉ định là vô hiệu, chẳng hạn như ở trên một ổ đĩa không được vẽ.

IOException

Thrown khi file đã mở.

UnauthorizedAccessException

Thrown khi truy cập vào tệp path’ bị từ chối.

PathTooLongException

Thrown khi con đường " được chỉ định vượt quá chiều dài tối đa được xác định bởi hệ thống.

Save(Stream, IsoSaveOptions)

Tiết kiệm hình ảnh ISO đến dòng cụ thể.

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

Parameters

stream Stream

dòng nơi hình ảnh ISO sẽ được lưu.

saveOptions IsoSaveOptions

Các tùy chọn để lưu ISO lưu trữ với.

Examples

Ví dụ sau đây cho thấy làm thế nào để lưu một lưu trữ ISO vào một dòng bộ nhớ:

// 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

Thrown khi lưu trữ không ở chế độ chỉnh sửa.

ArgumentNullException

Thrown khi stream’ là null.

ArgumentException

Thrown khi stream’ không thể viết được.

 Tiếng Việt