[
  {
    "Id": "189420",
    "ThreadId": "56090",
    "Html": "<p>I am using the code below, but Visual Studio always gives me this error:</p>\r\n<p>&quot;MyExtractProgress is not declared&quot;</p>\r\n<p>What should I declare it as?</p>\r\n<p><span id=\"ctl00_ctl00_MasterContent_Content_wikiSourceLabel\">\r\n<pre>  Dim ZipToUnpack As String = &quot;C1P3SML.zip&quot;  <br>   Dim TargetDir As String = &quot;C1P3SML&quot;  <br>   Console.WriteLine(&quot;Extracting file {0} to {1}&quot;, ZipToUnpack, TargetDir)   <br>   Using zip1 As ZipFile = ZipFile.Read(ZipToUnpack)   <br>       AddHandler zip1.ExtractProgress, AddressOf MyExtractProgress   <br>       Dim e As ZipEntry   <br>       ' here, we extract every entry, but we could extract    <br>       ' based on entry name, size, date, etc.   <br>       For Each e In zip1   <br>           e.Extract(TargetDir, ExtractExistingFileAction.OverwriteSilently)   <br>       Next  <br>   End Using<br><br>Thanks!<br></pre>\r\n</span></p>",
    "PostedDate": "2009-05-12T10:56:09.93-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "189515",
    "ThreadId": "56090",
    "Html": "<p>It is an event handler; it's documented in the .chm file. If you look for the ZipFile.ExtractProgress property, it gives you an example that includes this code:</p>\r\n<pre>Public 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\nEnd Sub\r\n</pre>\r\n<p>Such an event handler would make sense only if you are using the code within a Cosnole app. If it is a WinForms app, you will want to update a status textbox, or a progressbar, or something else with each call of the event handler.</p>",
    "PostedDate": "2009-05-12T15:33:49.72-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  }
]