I am using third party FastZip to zip my folder, when i zip new folder with already existing file let say abc.zip, Fast Zip overwite this old abc.zip, delete old files and zip only new files.
Any one knows the solution.
EDIT-> I managed to do that by myself, Here is a solution if some one need.
using ICSharpCode.SharpZipLib.Zip;
using ICSharpCode.SharpZipLib.Core;
string zipfilename = "abc.zip"; // Your required zip file
string fdrname = "abc";
if (!File.Exists(zipfilename)) // If file zip does not exists
{
Directory.CreateDirectory(fdrname); // Create folder with same name
FastZip fz = new FastZip(); // using FastZip dll
fz.CreateZip(zipfilename, fdrname, true, null); // create zip file (ofcourse its empty)
}
if (Directory.Exists(fdrname)) // delete folder which you have created (optional)
Directory.Delete(fdrname);
try
{
ZipFile zip = new ZipFile(zipfilename); // by Using ZipFile dll
zip.BeginUpdate();
zip.Add(pathtofile); // add file path which you want to zip in abc.zip
zip.CommitUpdate();
zip.Close();
}
catch (Exception e)
{
Console.WriteLine((e.ToString());
}
}