using Ionic.Zip;using System.IO;public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } //UnZip Process protected void BtnUnzip_Click(object sender, EventArgs e) { //source location of zip file string sourceLocation = "D:\\images.zip"; //After extract where placed that files string destLocation = "D:\\destfolder"; //Conditional extract and placed in this folder string CondFiles = "D:\\condfolder"; //Extract all files in the zip file using (ZipFile zip1 = ZipFile.Read(sourceLocation)) { //Full file extract code foreach (ZipEntry e1 in zip1) { e1.Extract(destLocation, ExtractExistingFileAction.OverwriteSilently); } //Based on the conditions to extract foreach (ZipEntry e2 in zip1) { //Extract only txt files in extract folder if (e2.FileName.ToString().Substring((e2.FileName.LastIndexOf('.') + 1), (e2.FileName.ToString().Length - e2.FileName.LastIndexOf('.') - 1)) == "jpg") { e2.Extract(CondFiles, ExtractExistingFileAction.OverwriteSilently); } } } } }