'FileZip compression with cancellation

How to cancel long running compression task and release all resources when using ZipFile.CreateFromDirectory or other ZipFile compression methods in C#.

Couldn't find any native method or parameter that help to cancel the compression.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source