The BuildingZipByteProgression event is raised when the target zip file is being built from the temporary files, for every 8 kb processed.
Keep in mind that using the BuildingZipByteProgression event increases the time it takes to process the temporary files. The reason behind this is that the data associated with the file will be scanned twice. The first time the files are scanned, information regarding the files will be accumulated ( filename, size, etc.. ). This is to allow accurate progress information to be returned during the actual processing of the files.
Purpose
The main purpose of the BuildingZipByteProgression event is to provide feedback to the user during the process of moving the temporary files to the temporary zip file to prevent the application from appearing frozen.
Basic steps - C#
To subscribe to the BuildingZipByteProgression event, the following steps must be performed:
-
Create a reference to a ZipEvents object.
-
Subscribe to the BuildingZipByteProgression event of the ZipEvents object using the BuildingZipByteProgressionEventHandler delegate class.
-
Create a new method that will handle the events that are raised. For the purposes of this example, we will call the method OnBuildingZipByteProgression.
-
Place the desired code in the newly created event handler.
Basic steps - VB.NET
To subscribe to the BuildingZipByteProgression event, the following steps must be performed:
-
Create a reference to a ZipEvents object using the WithEvents keyword.
-
Select the BuildingZipByteProgression event from the list of available methods in the newly instantiated ZipEvents object. This is done in the same manner as, for example, adding the DoubleClick event of a ListBox.
You can also subscribe to the event using the AddHandler/AddressOf statement. -
Place the desired code in the newly added event handler.
Demonstration
This example demonstrates how to delete a folder from within a zip file and display progress information during the operation.
VB.NET | Copy Code |
---|---|
|
C# | Copy Code |
---|---|
|