Class ArchiveFactory

Class ArchiveFactory

İsim alanı : Aspose.Zip Toplama: Aspose.Zip.dll (25.5.0)

Arşiv biçimini tespit eder ve arşiv türüne göre uygun Aspose.Zip.IArchive nesnesini oluşturur.

public static class ArchiveFactory

Inheritance

object ArchiveFactory

mirasçı üyeleri

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

Methods

CompressDirectory(string, string, arşiv formatı)

Belirlenen dizinleri sağlanan arşiv biçimini kullanarak bir arşiv dosyasına sıkıştırır.

public static void CompressDirectory(string path, string outputFileName, ArchiveFormat archiveFormat)

Parameters

path string

Kompres edilecek dizinlere giden yol.

outputFileName string

Destinasyon dosyası adı.

archiveFormat ArchiveFormat

oluşturulması gereken arşiv biçimi (örneğin, zip, rar, tar, vb.)

Examples

İşte CompressDirectory yöntemi nasıl kullanılacağına dair bir örnek:

string directoryPath = @"C:\path\to\your\directory";
ArchiveInfo.ArchiveFormat format = ArchiveInfo.ArchiveFormat.Zip;
ArchiveFactory.CompressDirectory(directoryPath, "result", format);
// This will create a zip file with the contents of the directory at the specified path.

Remarks

Bu yöntem, path’ parametresi tarafından belirtilen konumda bir arşiv dosyası oluşturur.Arşiv dosyasının adı genellikle archiveFormat’a dayalı uygun dosya uzantısı tarafından takip edilen dizin adı olacaktır.

Exceptions

DirectoryNotFoundException

path’ ile belirtilen dizin mevcut değilse.

ArgumentException

path’ sıfır veya boş bir satır ise.

NotSupportedException

Belirlenen archiveFormat’ desteklenmiyorsa veya tanınmıyorsa.

GetArchive(Sırt)

Arşiv biçimini tespit eder ve verilen yol tarafından belirtilen arşiv türüne göre uygun Aspose.Zip.IArchive nesnesini oluşturur.

public static IArchive GetArchive(string path)

Parameters

path string

Arşivlere giden yol analiz edilmelidir.

Returns

IArchive

Bir Aspose.Zip.IArchive nesne arşivini temsil eder.

GetArchive(Stream)

Arşiv biçimini tespit eder ve verilen akım tarafından belirtilen arşiv türüne göre uygun Aspose.Zip.IArchive nesnesini oluşturur.

public static IArchive GetArchive(Stream stream)

Parameters

stream Stream

Arşiv verilerini içeren akım. arama yapılabilir olmalıdır.

Returns

IArchive

Bir Aspose.Zip.IArchive nesne arşivini temsil eder.

GetArchive(akış, string)

Arşiv biçimini tespit eder ve belirli akım tarafından belirtilen şifreli arşiv türüne göre uygun Aspose.Zip.IArchive nesnesini oluşturur.

public static IArchive GetArchive(Stream stream, string password)

Parameters

stream Stream

Arşiv verilerini içeren akım. arama yapılabilir olmalıdır.

password string

Şifreli bir arşiv çözmek için şifre.

Returns

IArchive

Bir Aspose.Zip.IArchive nesne arşivini temsil eder.

 Türkçe