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.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Umesh AgrawalPosted Nov 15, 2014, 4:32 AM
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