Class ArchiveFactory

Class ArchiveFactory

이름 공간 : Aspose.Zip 모임: Aspose.Zip.dll (25.5.0)

아카이브 형식을 감지하고 아카이브 유형에 따라 적절한 Aspose.Zip.IArchive 개체를 만듭니다.

public static class ArchiveFactory

Inheritance

object ArchiveFactory

상속 회원들

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

Methods

CompressDirectory(링크, 링크, ArchiveFormat)

지정된 디렉토리를 제공된 아카이브 형식을 사용하여 아카이브 파일로 압축합니다.

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

Parameters

path string

압축 될 디렉토리로 가는 길.

outputFileName string

목적지 파일 이름

archiveFormat ArchiveFormat

만들어야 할 아카이브 형식 (예를 들어, zip, rar, tar 등)

Examples

다음은 CompressDirectory 방법을 사용하는 방법의 예입니다 :

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

이 방법은 path’ parameter에 의해 지정된 위치에 아카이브 파일을 생성합니다.아카이브 파일의 이름은 일반적으로 archiveFormat에 기반한 적절한 파일 확장에 따라 디렉토리 이름이 될 것입니다.이 디렉토리 자체는 변경되거나 삭제되지 않습니다.

Exceptions

DirectoryNotFoundException

path"에 의해 지정된 디렉토리가 존재하지 않는 경우에 통과합니다.

ArgumentException

path’가 null 또는 빈 줄이 있는 경우 흐르십시오.

NotSupportedException

지정된 archiveFormat’이 지원되지 않거나 인식되지 않은 경우.

GetArchive(스트리트)

아카이브 형식을 감지하고 특정 경로에 의해 지정된 아카이브 유형에 따라 적절한 Aspose.Zip.IArchive 개체를 만듭니다.

public static IArchive GetArchive(string path)

Parameters

path string

분석할 수 있는 아카이브로 가는 길.

Returns

IArchive

A Aspose.Zip.IArchive 개체는 아카이브를 나타냅니다.

GetArchive(Stream)

아카이브 형식을 감지하고 해당 스트림에 의해 지정된 아카이브 유형에 따라 적절한 Aspose.Zip.IArchive 개체를 만듭니다.

public static IArchive GetArchive(Stream stream)

Parameters

stream Stream

아카이브 데이터를 포함하는 스트림.그것은 검색 가능해야합니다.

Returns

IArchive

A Aspose.Zip.IArchive 개체는 아카이브를 나타냅니다.

GetArchive(스트리밍, 스트리밍)

아카이브 형식을 감지하고 해당 스트림에 의해 지정된 암호화 된 아카이브 유형에 따라 적절한 Aspose.Zip.IArchive 개체를 만듭니다.

public static IArchive GetArchive(Stream stream, string password)

Parameters

stream Stream

아카이브 데이터를 포함하는 스트림.그것은 검색 가능해야합니다.

password string

암호화 된 아카이브를 해독하기위한 암호.

Returns

IArchive

A Aspose.Zip.IArchive 개체는 아카이브를 나타냅니다.

 한국어