I have a .lst file that has the paths of various data that has to be zipped. The path may be a direct path to an executable or a path to a log file or may contain a wildcard like – c:\abc*.exe. How do I zip all of them into a single zip file? Thanks
DotNetZip Library is @:http://dotnetzip.codeplex.com/wikipage?title=CS-examples&referringTitle=Examples
Contents of .lst file :
c:\log\abc.log
c:\log\def.log
c:\ping*.bat
c:\ping*.exe
This is what I tried:
using (ZipFile zip = new ZipFile())
{
StreamReader file = File.OpenText("C:\\pingman\\pingzipA.lst");
string read = String.Empty;
while ((read = file.ReadLine()) != null)
{
zip.AddSelectedFiles(read, true);
zip.Save("c:\\update.zip");
}
file.Close();
}
Try something like: