[
  {
    "Id": "191902",
    "ThreadId": "56777",
    "Html": "<p>Are there any samples, explanations, or tips dealing with the changed namespace of 1.7 (VB.NET 2008)? Because when I downloaded the binary I again got a Ionic.Utils.dll and I cannot find anything that would help me show a progress report during the .save() operation.</p>\r\n<p>There are simply two things I want to do: speed up the way the resulting ZIP is saved (adding recursive entries works fine and fast) or at least report to the user what the ZIP operation is doing. And on the other side of the coin I would like to unpack files without whatever folder structure may be inside the ZIP (these are downloads, so I have no control over their creation). Thus far I have not found anyway to do either.</p>\r\n<p>Any &amp; all help would be appreciated.</p>",
    "PostedDate": "2009-05-19T06:38:31.613-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "191989",
    "ThreadId": "56777",
    "Html": "<p>v1.7 uses Ionic.Zip as the namespace, replacing Ionic.Utils.Zip.&nbsp; The name of the DLL is Ionic.Zip.dll.&nbsp; There is no Ionic.Utils.dll - there never was a file by that name in any release of DotNetZip.&nbsp; typo on your part?</p>\r\n<p>If you still see an Ionic.Utils.Zip namespace in Visual Studio, then you are referencing an older version of the library.&nbsp; You can find out the version of the library you are using at runtime with the ZipFile.LibraryVersion property. It is a static (Shared in VB) property.</p>\r\n<p>To address your two things:</p>\r\n<ol>\r\n<li>To report progress, you have the events: ReadProgress, SaveProgress and ExtractProgress on the ZipFile class.&nbsp; They work pretty much like events on any .NET class. Add an event handler and you will get notified.&nbsp; The help file (.chm file) includes complete documentation for these events, including examples in VB source code for how to do this. Also the 3rd example on &nbsp;<a href=\"http://dotnetzip.codeplex.com/Wiki/View.aspx?title=VB-examples\"> this page</a>&nbsp; includes an example with an ExtractProgress event handler in VB. </li>\r\n<li>To extract and flatten the file structure, you have several options.&nbsp; I would suggest renaming the entry, and then extracting it.&nbsp;&nbsp; </li>\r\n</ol>\r\n<p>Here's a code example that address both of your issues:</p>\r\n<pre>    Private Shared justHadByteUpdate As Boolean = False\r\n    \r\n    ' if this is a Winforms GUI, will want to update a progress bar or \r\n    ' similar.\r\n    Private Shared Sub MyExtractProgress(ByVal sender As Object, ByVal e As ExtractProgressEventArgs)\r\n        If (e.EventType Is ZipProgressEventType.Extracting_EntryBytesWritten) Then\r\n            If ExtractTest.justHadByteUpdate Then\r\n                Console.SetCursorPosition(0, Console.CursorTop)\r\n            End If\r\n            Console.Write(&quot;   {0}/{1} ({2:N0}%)&quot;, e.BytesWritten, e.TotalBytesToWrite, (CDbl(e.BytesWritten) / (0.01 * e.TotalBytesToWrite)))\r\n            ExtractTest.justHadByteUpdate = True\r\n        ElseIf (e.EventType Is ZipProgressEventType.Extracting_BeforeExtractEntry) Then\r\n            If ExtractTest.justHadByteUpdate Then\r\n                Console.WriteLine\r\n            End If\r\n            Console.WriteLine(&quot;Extracting: {0}&quot;, e.NameOfLatestEntry)\r\n            ExtractTest.justHadByteUpdate = False\r\n        End If\r\n    End Sub\r\n\r\n    Private Sub MyExtract\r\n      Dim Overwrite as ExtractExistingFileAction = ExtractExistingFileAction.OverwriteSilently\r\n      Dim ZipToUnpack As String = &quot;C1P3SML.zip&quot;  \r\n      Dim UnpackDirectory As String = &quot;Extracted Files&quot;\r\n      StatusMessage.Text = String.Format(&quot;Extracting file {0} to {1}&quot;, ZipToUnpack, UnpackDirectory )\r\n      Using zip1 As ZipFile = ZipFile.Read(ZipToUnpack)\r\n           ' register a progress event for extraction   \r\n\t  AddHandler zip1.ExtractProgress, AddressOf MyExtractProgress   \r\n\t  Dim e As ZipEntry   \r\n\t  ' here, we extract every entry, but we could extract conditionally,\r\n\t  ' based on entry name, size, date, checkbox status, etc.   \r\n\t  For Each e In zip1\r\n               ' rename the entry to remove the path\r\n               e.FileName = System.IO.Path.GetFileName(e.FileName)\r\n               ' extract that entry into the directory\r\n\t      e.Extract(UnpackDirectory, Overwrite)\r\n\t  Next  \r\n      End Using   \r\n    End Sub\r\n</pre>",
    "PostedDate": "2009-05-19T10:03:25.033-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "192027",
    "ThreadId": "56777",
    "Html": "<p>Thanks for the example; I'll convert it to my usage. As for the version, The reference clearly states <strong>Ionic.Util.zip.dll</strong>, <strong>Version 1.7.1.10</strong> (what I wrote earlier was indeed a typo) - as I found it in the binary download. Up until then I was using 1.6.x.xx. What surprises me in both cases is how excrutiatingly slow the archiving process is: WinZip, even older versions, provided an only marginally smaller archive in 1/5th of the of the exact same files. I thus use it only for the smallest of backups and, of course, for extraction which is perfectly find, speed-wise.</p>",
    "PostedDate": "2009-05-19T11:32:48.683-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "192127",
    "ThreadId": "56777",
    "Html": "<p>Ahh, yes, you are using a preview release of v1.7.&nbsp;</p>\r\n<p>The first &quot;official&quot; release was v1.7.2.4.&nbsp;<a href=\"http://dotnetzip.codeplex.com/Thread/View.aspx?ThreadId=46688\">http://dotnetzip.codeplex.com/Thread/View.aspx?ThreadId=46688</a>&nbsp; &nbsp;Up until then, things were still changing, including, as you have seen, the namespace.&nbsp;</p>\r\n<p>I'd encourage you to get the latest v1.7 release.&nbsp;</p>\r\n<p>If you want increased speed, I can suggest v1.8, which is packaged as a RELEASE dll, and consequently delivers significantly better performance that v1.7, which was delivered only as a DEBUG dll.&nbsp; But, v1.8 is still in preview!</p>\r\n<p>I don't know how you are doing the timing comparisons; I'd be interested to hear your methodology, in particular how you are able to get a VB.NET app to use the winzip DLL.&nbsp; Or maybe you are just using the command-line or GUI tools for timing comparisons?&nbsp; What I've found is that WinZip is very fast, but not very accessible to .NET programs.&nbsp;</p>\r\n<p>Sorry DotNetZip has been so excruciating to you!</p>\r\n<p>&nbsp;</p>",
    "PostedDate": "2009-05-19T16:12:07.183-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "192249",
    "ThreadId": "56777",
    "Html": "<p>Not excrutiating at all; for the most part I use your library for extracting and that all works brilliantly. Maybe you would consider the idea of adding a switch that would permit easy switching extract without folder? Just dreaming.</p>\r\n<p>As for the comparative test - no, I did not extract the DLL but simply timed the WinZIP GUI. I'll be trying 1.8 today and see what happens.</p>",
    "PostedDate": "2009-05-20T01:29:23.423-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "193405",
    "ThreadId": "56777",
    "Html": "This discussion has been copied to a work item. Click <a href=\"http://dotnetzip.codeplex.com/WorkItem/View.aspx?WorkItemId=7803\">here</a> to go to the work item and continue the discussion.",
    "PostedDate": "2009-05-22T15:34:44.147-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  }
]