[
  {
    "Id": "535445",
    "ThreadId": "238294",
    "Html": "\r\n<p>Hello</p>\r\n<p>I try to code an app for back up my files.</p>\r\n<p>I have a checked Listbox item where i add or remove files that i want to zip&nbsp;practically it contains the paths to my files.</p>\r\n<p>Let`s say that a file is missing on my hdd but it still has the path in checked ListBox and when zip sub is called it give me an error : &quot;The file or directory does not exist !&quot;</p>\r\n<p>I tried to use&nbsp;zip.ZipErrorAction = ZipErrorAction.Skip to skip the missing files but it keeps to return the same error.</p>\r\n<p>My code looks like :</p>\r\n<p></p>\r\n<div style=\"color:black; background-color:white\">\r\n<pre><span style=\"color:blue\">Imports</span> Ionic.Zip\r\n<span style=\"color:blue\">Module</span> subrutine\r\n<span style=\"color:blue\">Public</span> <span style=\"color:blue\">Sub</span> zip()\r\n        <span style=\"color:blue\">Call</span> stergeZip()\r\n        <span style=\"color:blue\">Try</span>\r\n            <span style=\"color:blue\">If</span> index.listaFisiere.Items.<span style=\"color:blue\">Count</span> &lt;&gt; 0 <span style=\"color:blue\">Then</span>\r\n                <span style=\"color:blue\">Using</span> zip <span style=\"color:blue\">As</span> ZipFile = <span style=\"color:blue\">New</span> ZipFile()\r\n                    \r\nzip.ZipErrorAction = ZipErrorAction.<span style=\"color:blue\">Skip</span>\r\n\r\n                    <span style=\"color:blue\">For</span> <span style=\"color:blue\">Each</span> item <span style=\"color:blue\">In</span> index.listaFisiere.Items\r\n                        zip.AddItem(item)\r\n                    <span style=\"color:blue\">Next</span>\r\n                    zip.Save(numeArhiva)\r\n                    zip.Dispose()\r\n                <span style=\"color:blue\">End</span> <span style=\"color:blue\">Using</span>\r\n                <span style=\"color:blue\">If</span> <span style=\"color:blue\">My</span>.Settings.FTPPornit = <span style=\"color:blue\">True</span> <span style=\"color:blue\">Then</span> <span style=\"color:blue\">Call</span> ftp()\r\n                <span style=\"color:blue\">If</span> <span style=\"color:blue\">My</span>.Settings.HDDPornit = <span style=\"color:blue\">True</span> <span style=\"color:blue\">Then</span> <span style=\"color:blue\">Call</span> hdd()\r\n                <span style=\"color:blue\">If</span> <span style=\"color:blue\">My</span>.Settings.mailPornit = <span style=\"color:blue\">True</span> <span style=\"color:blue\">Then</span> <span style=\"color:blue\">Call</span> mail()\r\n                <span style=\"color:blue\">With</span> index.balon\r\n                    .BalloonTipText = <span style=\"color:#a31515\">&quot;Back up efectuat cu succes !&quot;</span>\r\n                    .BalloonTipIcon = ToolTipIcon.Info\r\n                    .ShowBalloonTip(1000)\r\n                <span style=\"color:blue\">End</span> <span style=\"color:blue\">With</span>\r\n            <span style=\"color:blue\">Else</span>\r\n                MsgBox(<span style=\"color:#a31515\">&quot;Lista fisiserelor nu contine niciun obiect&quot;</span>)\r\n            <span style=\"color:blue\">End</span> <span style=\"color:blue\">If</span>\r\n        <span style=\"color:blue\">Catch</span> Ex <span style=\"color:blue\">As</span> Exception\r\n            MsgBox(Ex.Message)\r\n            <span style=\"color:blue\">With</span> index.balon\r\n                .BalloonTipText = <span style=\"color:#a31515\">&quot;Back up esuat !&quot;</span>\r\n                .BalloonTipIcon = ToolTipIcon.<span style=\"color:blue\">Error</span>\r\n                .ShowBalloonTip(1000)\r\n            <span style=\"color:blue\">End</span> <span style=\"color:blue\">With</span>\r\n        <span style=\"color:blue\">End</span> <span style=\"color:blue\">Try</span>\r\n    <span style=\"color:blue\">End</span> <span style=\"color:blue\">Sub</span>\r\n<span style=\"color:blue\">End</span> <span style=\"color:blue\">Module</span>\r\n</pre>\r\n</div>\r\n<p></p>\r\n",
    "PostedDate": "2010-12-14T02:38:01.69-08:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "537440",
    "ThreadId": "238294",
    "Html": "\r\n<p>Hmm, that's an interesting case.&nbsp; I'll file a bug and fix that, some way.</p>\r\n<p>In the meantime you can avoid the problem completely by inserting a test for file existence before calling Zip.AddItem().&nbsp;</p>\r\n<p>like this:</p>\r\n<div style=\"color:black; background-color:white\">\r\n<pre><span style=\"color:blue\">If</span> (System.IO.File.Exists(item)) <span style=\"color:blue\">Then</span>\r\n    zip.AddItem(item)\r\n<span style=\"color:blue\">End</span> <span style=\"color:blue\">If</span>\r\n</pre>\r\n</div>\r\n",
    "PostedDate": "2010-12-17T11:00:15.363-08:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "537442",
    "ThreadId": "238294",
    "Html": "This discussion has been copied to a work item. Click <a href=\"http://dotnetzip.codeplex.com/workitem/12712\">here</a> to go to the work item and continue the discussion.",
    "PostedDate": "2010-12-17T11:02:44.173-08:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "538870",
    "ThreadId": "238294",
    "Html": "\r\n<p>Thank you. With your code mine program does what it should. Thank you again.</p>\r\n",
    "PostedDate": "2010-12-21T10:56:38.673-08:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  }
]