[]
Opens the zip file for multiple operations.
public void OpenBatch()
By default, C1ZipFile opens and closes the zip file automatically whenever entries are added or removed.
This can cause delays in systems that have certain types of anti-virus software installed, or in situations where you want to add a large number of relatively small entries. In these cases, use the OpenBatch() and CloseBatch() methods to keep the zip file open until the entire operation is concluded.
Use a finally clause to ensure that the CloseBatch() method is called even if an exception occurs.
The code below opens a zip file, adds several entries to it, then closes the file:
C1ZipFile zip = new C1ZipFile();
zip.Open(myzipfile);
try
{
zip.OpenBatch();
foreach (string fileName in Directory.GetFiles(path, "*.*"))
zip.Entries.Add(fileName);
}
finally
{
zip.CloseBatch();
}