Zip Extensions
In addition to the main ZipLibrary control, you could take advantage of a set of helper methods, divided in two classes, which will help you to implement your scenarios faster. All these methods are in the Telerik.Windows.Zip.Extensions.dll.
In UI for WinForms, the classes are merged in Telerik.WinControls.dll, so you will need to refer that assembly instead of Telerik.Windows.Zip.Extensions.dll.
In this article you will find the classes and their members.
The ZipFile class
With the ZipFile class, you can utilize static methods to create, extract, or open zip archives with minimal code. Starting with the Q2 2025 release, some methods now include an additional optional parameter (TimeSpan? timeout)
. The older overloads of these specific methods, which do not include this parameter, are now obsolete.
ZipArchiveEntry CreateEntryFromFile(this ZipArchive destination, string sourceFileName, string entryName, TimeSpan? timeout) – Archives a file by compressing it and adding it to the zip archive. You can also specify the CompressionLevel or CompressionSettings of the ZipEntry using other overloads.
void CreateFromDirectory(string sourceDirectoryName, string destinationArchiveFileName, TimeSpan? timeout): Creates a zip archive containing the files and directories from the specified directory. Additional overloads allow you to configure various settings for the entries.
void ExtractToDirectory(string sourceArchiveFileName, string destinationDirectoryName, TimeSpan? timeout): Extracts all the files in the specified zip archive to a directory on the file system.
void ExtractToFile(this ZipArchiveEntry source, string destinationFileName, TimeSpan? timeout): Extracts an entry in the zip archive to a file. You can also specify whether to overwrite an existing file with the same name as the destination file.
ZipArchive Open(string archiveFileName, ZipArchiveMode mode): Opens a zip archive at the specified path and in the specified mode. Another overload allows specifying the encoding to use when reading or writing entry names in this archive. Specify a value for this parameter only when an encoding is required for interoperability with zip archive tools and libraries that do not support UTF-8 encoding for entry names.
ZipArchive OpenRead(string archiveFileName): Opens a zip archive for reading at the specified path.
bool IsDirectoryEmpty(DirectoryInfo directoryInfo): Indicates whether specified directory is empty or not.
The DotNetPlatformManager class
This class implements the IPlatformManager interface, which provides platform-specific operations. In the general case you won't need to implement new platform managers, as this default implementation already take advantage of the current platform (.NET Framework) as much as possible.
Properties
string AltDirectorySeparatorChar: Gets a platform-specific alternate character used to separate directory levels in a path string that reflects a hierarchical file system organization.
Encoding DefaultEncoding: Gets default encoding for this platform.
string DirectorySeparatorChar: Gets a platform-specific character used to separate directory levels in a path string that reflects a hierarchical file system organization.
TemporaryStreamType TemporaryStreamType: Gets or sets type of the temporary stream. The default value is TemporaryStreamType.Memory.
Methods
stream CreateTemporaryStream(): Creates temporary stream. Stream will be used for temporary operations.
void DeleteTemporaryStream(Stream stream): Deletes temporary stream.
ICryptoProvider GetCryptoProvider(EncryptionSettingsBase settings): Gets crypto provider initialized using given encryption settings.
bool IsEncodingSupported(Encoding encoding): Indicates whether specified encoding is supported for this platform.
true if encoding is allowed in the ZIP file.