# C1.Zip.C1ZipFile.Progress

## Content

<div class="doc-site-dotnet-api-container">




<h1 id="C1_Zip_C1ZipFile_Progress" data-uid="C1.Zip.C1ZipFile.Progress" class="text-break">Progress Event
</h1>
<div class="markdown level0 summary"><p>Fired while data is being read from or written into a zip file.</p>
</div>
<div class="markdown level0 conceptual"></div>
<h6><strong>Namespace</strong>: <a class="xref" href="C1.Zip.html">C1.Zip</a></h6>
<h6><strong>Assembly</strong>: C1.Zip.dll</h6>
<h5 id="C1_Zip_C1ZipFile_Progress_syntax">Syntax</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public event ZipProgressEventHandler Progress</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Event Progress As ZipProgressEventHandler</code></pre>
</div>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="C1.Zip.ZipProgressEventHandler.html">ZipProgressEventHandler</a></td>
      <td>Fired while data is being read from or written into a zip file.</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_Zip_C1ZipFile_Progress_remarks"><strong>Remarks</strong></h5>
<div class="markdown level0 remarks"><p>This event is typically used to update the application UI during lengthy
operations. It can also be used to cancel the operations.</p>
</div>
<h5 id="C1_Zip_C1ZipFile_Progress_examples"><strong>Examples</strong></h5>
<p>The code below writes messages to the output window while the application
compresses files.</p>
<pre><code class="lang-csharp">void Compress()
{
	// create zip file
	C1Zip zip = new C1Zip();
	zip.Create(zipFileName);

	// connect event handler
	zip.Progress += new ZipProgressEventHandler(zip_Progress);

	// add files
	foreach (string fileName in Directory.GetFiles(path, "*.*"))
		zip.Entries.Add(fileName);
}

// print messages while files are compressed
void zip_Progress(object sender, ZipProgressEventArgs e)
{
	Console.WriteLine("Compressing {0}, {1:p0} done",
		e.FileName, e.Position/(float)e.FileLength);
}</code></pre>

</div>
