title: C# DotNetZip progressbar on directory
body: <p>I have the following code working for a single file zip without any problems. But when I zip (create) from a directory the progressbar goes nuts.</p>
  
  <p>Basically, the progressbar goes back and forward nonstop. The image illustrates.
  <a href="https://i.stack.imgur.com/g4xx5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/g4xx5.png" alt="enter image description here"></a></p>
  
  <p>Inside the folder selected I might have like another 10 sub-folders.</p>
  
  <pre><code>using (ZipFile zip = new ZipFile())
  {
      zip.CompressionLevel = Ionic.Zlib.CompressionLevel.BestCompression;
      zip.SaveProgress += zipProgress;
  
      zip.AddDirectory(folderPath);
      zip.Save(tempPath);
  }
  
  private void zipProgress(object sender, SaveProgressEventArgs e)
  {
      if (e.EventType == ZipProgressEventType.Saving_EntryBytesRead)
          this.progressbar1.Value = (int)((e.BytesTransferred * 100) / e.TotalBytesToTransfer);
  
      else if (e.EventType == ZipProgressEventType.Saving_Completed)
          this.progressbar1.Value = 100;
  }
  </code></pre>
  
  <p>I do realize that the fact of progress value continuously goes forward and back is due to the fact that I'm zipping one folder that contains 10 sub-folders. </p>
  
  <p>However i would like to know if there's any way of properly show the progressbar for folder zipping?</p>