본문 바로가기
컴퓨터/C#

C# 파일 압축 해제 방법

by Begi 2023. 6. 17.
반응형

C#에서 파일 압축 해제 방법은 다음과 같다.

 

using System;
using System.IO.Compression;

class Program
{
    static void Main(string[] args)
    {
        string startPath = @".\start";
        string zipPath = @".\result.zip";
        string extractPath = @".\extract";

        ZipFile.CreateFromDirectory(startPath, zipPath);

        ZipFile.ExtractToDirectory(zipPath, extractPath);
    }
}

 

반응형

댓글