[
  {
    "Id": "225147",
    "ThreadId": "66284",
    "Html": "<p>if you loop through a zip file and extract each file in the zip, does the extraction of the file from the zip occur in each call to extract or at the end?&nbsp; If not how can I get each file to exist?</p>\r\n<p>as in the example below.</p>\r\n<p>Dim ZipToUnpack As String = &quot;C1P3SML.zip&quot;&nbsp; <br>&nbsp;&nbsp; Dim TargetDir As String = &quot;C1P3SML&quot;&nbsp; <br>&nbsp;&nbsp; Console.WriteLine(&quot;Extracting file {0} to {1}&quot;, ZipToUnpack, TargetDir)&nbsp;&nbsp; <br>&nbsp;&nbsp; Using zip1 As ZipFile = ZipFile.Read(ZipToUnpack)&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; AddHandler zip1.ExtractProgress, AddressOf MyExtractProgress&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim e As ZipEntry&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' here, we extract every entry, but we could extract&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' based on entry name, size, date, etc.&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; For Each e In zip1&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; e.Extract(TargetDir, ExtractExistingFileAction.OverwriteSilently)&nbsp;&nbsp;</p>\r\n<p>' does each file exist at this point</p>\r\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Next&nbsp; <br>&nbsp;&nbsp; End Using&nbsp;</p>",
    "PostedDate": "2009-08-18T14:24:35.943-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "225149",
    "ThreadId": "66284",
    "Html": "<p>Norton, you keep using different signin names?</p>\r\n<p>The file will exist immediately after the call to e.Extract() returns.&nbsp;</p>",
    "PostedDate": "2009-08-18T14:29:27.723-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "225164",
    "ThreadId": "66284",
    "Html": "\r\n\r\n<div class=Section1>\r\n\r\n<p class=MsoNormal>I was using the <span class=selflink><span style=\"font-size:8.5pt;font-family:'Verdana','sans-serif';color:black\">Extract(String, ExtractExistingFileAction)</span></span><span style=\"font-size:8.5pt;font-family:'Verdana','sans-serif';color:black\"> overload\r\nand found that extract was extracting to the base directory(string) and then\r\nadding in the ZIP folder pathing to place the file further down the base\r\ndirectory.  In Winzip to solve this problem I uncheck the “Use\r\nFolder</span> name” and Winzip places in the unzipped file in the base\r\ndirectory.   What can I do to get the files in the zip only in the\r\nbase directory with no ZIP folder names?</p>\r\n\r\n<p class=MsoNormal> </p>\r\n\r\n<p class=MsoNormal>Thanks</p>\r\n\r\n<p class=MsoNormal> </p>\r\n\r\n<p class=MsoNormal>Colby</p>\r\n\r\n</div>\r\n\r\n\r\n\r\n<pre>**********************************************************************\r\nThis communication does not reflect an intention by the sender or the \r\nsender's client or principal to conduct a transaction or make any \r\nagreement by electronic means.  Nothing contained within either this \r\nmessage or any attachment shall satisfy the requirements for a writing, \r\nand nothing contained herein shall constitute a contract or electronic \r\nsignature under the Electronic Signatures in Global and National \r\nCommerce Act (ESIGN), any version of the Uniform Electronic Transactions\r\nAct (UETA), or any other statute governing electronic transactions. This\r\nelectronic transmission and any attached documents or other writings are\r\nconfidential and for the sole use of the intended recipient(s) identified\r\nabove.  This message may contain information that is privileged, \r\nconfidential, or otherwise protected from disclosure under applicable law.  \r\nIf you are not the intended recipient, or employee, or agent responsible \r\nfor delivering the information to the intended recipient, you are hereby \r\nnotified that any use, reading, dissemination, distribution, copying, or \r\nstorage of this information is strictly prohibited.\r\nIf you have received this information in error, please notify Town North \r\nBank via e-mail at IntrusionDetection@tnbonline.com and delete the \r\nelectronic transmission, including all attachments from your system.\r\n**********************************************************************",
    "PostedDate": "2009-08-18T15:15:16.45-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "225192",
    "ThreadId": "66284",
    "Html": "<p>For now, you have to reset the name of the entry, conditionally, like this:</p>\r\n<div style=\"color:Black;background-color:White\">\r\n<pre>  <span style=\"color:Blue\">Using</span> zip1 <span style=\"color:Blue\">As</span> ZipFile = ZipFile.Read(ZipPath)\r\n      <span style=\"color:Blue\">For</span> <span style=\"color:Blue\">Each</span> e <span style=\"color:Blue\">As</span> ZipEntry <span style=\"color:Blue\">In</span> zip1\r\n          <span style=\"color:Blue\">If</span> e.FileName.Contains(<span style=\"color:#A31515\">&quot;/&quot;</span>) <span style=\"color:Blue\">Then</span>\r\n              <span style=\"color:Blue\">Dim</span> s <span style=\"color:Blue\">As</span> <span style=\"color:Blue\">String</span> = System.IO.Path.GetFileName(e.FileName)\r\n              <span style=\"color:Blue\">Dim</span> n <span style=\"color:Blue\">As</span> <span style=\"color:Blue\">Integer</span> = 0\r\n              <span style=\"color:Blue\">Do</span> <span style=\"color:Blue\">While</span> <span style=\"color:Blue\">Not</span> (zip1(s) <span style=\"color:Blue\">Is</span> <span style=\"color:Blue\">Nothing</span>)\r\n                  n = n+1\r\n                  s = System.IO.Path.GetFileNameWithoutExtension(e.FileName) &amp; <span style=\"color:#A31515\">&quot;.&quot;</span> &amp; n.ToString() &amp; _\r\n                      System.IO.Path.GetExtension(e.FileName) \r\n              <span style=\"color:Blue\">Loop</span>\r\n              e.FileName = s\r\n          <span style=\"color:Blue\">End</span> <span style=\"color:Blue\">If</span>\r\n          e.Extract(extractPath, ExtractExistingFileAction.OverwriteSilently)\r\n      <span style=\"color:Blue\">Next</span>\r\n  <span style=\"color:Blue\">End</span> <span style=\"color:Blue\">Using</span>\r\n\r\n</pre>\r\n</div>\r\n<p>This code ensures that any entries that share a base name with other entries in the ZipFile, are extracted with unique names.</p>\r\n<p>There's an open workitem (<a href=\"http://dotnetzip.codeplex.com/WorkItem/View.aspx?WorkItemId=7803\">7803</a>) requesting that this capability be built-in.</p>",
    "PostedDate": "2009-08-18T16:37:22.227-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "225217",
    "ThreadId": "66284",
    "Html": "<p>ok, I just released v1.8.4.19. With that release there's a new property on the ZipFile class to make this simpler. It's called FlattenFoldersOnExtract. Use it like this:</p>\r\n<div style=\"color:Black;background-color:White\">\r\n<pre><span style=\"color:Blue\">Using</span> zip1 <span style=\"color:Blue\">As</span> ZipFile = ZipFile.Read(ZipPath)\r\n    zip1.FlattenFoldersOnExtract = <span style=\"color:Blue\">True</span>\r\n    <span style=\"color:Blue\">For</span> <span style=\"color:Blue\">Each</span> e <span style=\"color:Blue\">As</span> ZipEntry <span style=\"color:Blue\">In</span> zip1\r\n        e.Extract(extractPath, ExtractExistingFileAction.OverwriteSilently)\r\n    <span style=\"color:Blue\">Next</span>\r\n<span style=\"color:Blue\">End</span> <span style=\"color:Blue\">Using</span>\r\n\r\n</pre>\r\n</div>\r\n<p>or this:</p>\r\n<div style=\"color:Black;background-color:White\">\r\n<pre><span style=\"color:Blue\">Using</span> zip1 <span style=\"color:Blue\">As</span> ZipFile = ZipFile.Read(ZipPath)\r\n    zip1.FlattenFoldersOnExtract = <span style=\"color:Blue\">True</span>\r\n    zip1.ExtractAll(extractPath, ExtractExistingFileAction.OverwriteSilently)\r\n<span style=\"color:Blue\">End</span> <span style=\"color:Blue\">Using</span>\r\n\r\n</pre>\r\n</div>\r\n<p>&nbsp;</p>",
    "PostedDate": "2009-08-18T18:41:05.14-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "225893",
    "ThreadId": "66284",
    "Html": "\r\n\r\n<div class=Section1>\r\n\r\n<p class=MsoNormal>Thanks for your help.  Downloaded the new release and\r\nit worked.</p>\r\n\r\n<p class=MsoNormal> </p>\r\n\r\n</div>\r\n\r\n\r\n\r\n<pre>**********************************************************************\r\nThis communication does not reflect an intention by the sender or the \r\nsender's client or principal to conduct a transaction or make any \r\nagreement by electronic means.  Nothing contained within either this \r\nmessage or any attachment shall satisfy the requirements for a writing, \r\nand nothing contained herein shall constitute a contract or electronic \r\nsignature under the Electronic Signatures in Global and National \r\nCommerce Act (ESIGN), any version of the Uniform Electronic Transactions\r\nAct (UETA), or any other statute governing electronic transactions. This\r\nelectronic transmission and any attached documents or other writings are\r\nconfidential and for the sole use of the intended recipient(s) identified\r\nabove.  This message may contain information that is privileged, \r\nconfidential, or otherwise protected from disclosure under applicable law.  \r\nIf you are not the intended recipient, or employee, or agent responsible \r\nfor delivering the information to the intended recipient, you are hereby \r\nnotified that any use, reading, dissemination, distribution, copying, or \r\nstorage of this information is strictly prohibited.\r\nIf you have received this information in error, please notify Town North \r\nBank via e-mail at IntrusionDetection@tnbonline.com and delete the \r\nelectronic transmission, including all attachments from your system.\r\n**********************************************************************",
    "PostedDate": "2009-08-20T08:01:48.427-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "225898",
    "ThreadId": "66284",
    "Html": "<p>great, glad it worked for you.</p>",
    "PostedDate": "2009-08-20T08:06:58.8-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  }
]