How To Extract Zip File Using C# Code

In the previous article, I have explained about to Create the Zip file from the Directory. In this article, I’m gonna explain that how we can extract Zip files using C# code.

C# Code

using System;
using System.IO.Compression;

namespace ExtractZip
{
    class Program
    {
        static void Main(string[] args)
        {
            //Unzip file
            ZipFile.ExtractToDirectory(@"D:\Icons.zip", @"D:\Icons");
        }
    }
}

ZipFile.ExtractToDirectory will extract the Zip file to a directory. Here, you need to pass the source zip file path as a first parameter and the directory name with the path as a second parameter.

Output

Submit a Comment

Your email address will not be published.

Subscribe

Select Categories