Hiiiii
how to compress all the files from different paths into a single zip file that can be copied to another folder using C# console application
Please suggest Me
Know the answer? Post it. Somebody with the same question will find it here.
Umesh Agrawal6 pointsPosted Nov 14, 2014, 11:32 PM EST
string[] filenames = Directory.GetFiles(path);
using (ZipFile zip = new ZipFile())
{
foreach (GridViewRow row in gv.Rows)
{
if ((row.FindControl("chkSelect") as CheckBox).Checked)
{
string filePath = (row.FindControl("lblFilePath") as Label).Text;
zip.AddFile(filePath, "downloadedFiles");
}
}
zip.Save(Server.MapPath("~/samplefiles.zip"));
i above i have used gridview with checkbox
u can give diff path from here