[
  {
    "Id": "927561",
    "ThreadId": "399627",
    "Html": "\r\n<p>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</p>\r\n<p><strong>Contents of .lst file</strong> :</p>\r\n<p>c:\\log\\abc.log</p>\r\n<p>c:\\log\\def.log</p>\r\n<p>c:\\ping\\*.bat</p>\r\n<p>c:\\ping\\*.exe</p>\r\n<p><strong>This is what I tried</strong>:</p>\r\n<p>using (ZipFile zip = new ZipFile())&nbsp;</p>\r\n<p>&nbsp;{ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</p>\r\n<p><span style=\"white-space:pre\"></span>StreamReader file = File.OpenText(&quot;C:\\\\pingman\\\\pingzipA.lst&quot;);&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</p>\r\n<p><span style=\"white-space:pre\"></span>string read = String.Empty;<br>\r\n&nbsp; &nbsp; &nbsp; &nbsp; while ((read = file.ReadLine()) != null)&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</p>\r\n<p><span style=\"white-space:pre\"></span>{&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</p>\r\n<p><span style=\"white-space:pre\"></span>zip.AddSelectedFiles(read, true);</p>\r\n<p>&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; zip.Save(&quot;c:\\\\update.zip&quot;);&nbsp; &nbsp;</p>\r\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</p>\r\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;file.Close();</p>\r\n<p>&nbsp; }&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</p>\r\n",
    "PostedDate": "2012-10-16T10:24:07.9-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  }
]