PowerTCP Zip Compression for .NET

from $299.00
Available Platforms

PowerTCP Zip Compression for .NET Tool

A .NET Zip library that provides the flexibility, security, performance, and support desired for efficiently integrating zip compression and encryption into your development projects. Includes many C# and VB code examples and samples. Here are some features not found in the .NET Framework.

 

Consulting and Custom Development

From custom protocols to complete client-server solutions, let our experienced staff help with your Zip project.

 

Flexibility and Ease-of-Use

  • WinZip, PKZIP, and UNIX gZip compatible
  • Three levels of compression/performance control
  • Large file (over 4 GB) support
  • QuickZip and QuickUnzip short-cut methods
  • Unicode filename support for international character sets
  • 64-bit OS support
  • Integrates with Visual Studio 2005, 2008, 2010
More...

 

High Performance

  • High-performance compression engine
  • Optimized "on the fly" streaming compression and inflation, without buffering to disk or memory
  • Add files without re-compressing the entire archive
  • Multi-threaded asynchronous functionality
  • Fully developed in managed C#
More...

 

Comprehensive Security

  • WinZip compatible security
  • Standard zip encryption support
  • AES encryption - 128-bit, 192-bit and 256-bit options
  • "On the fly" encryption and decryption
More...

 

Highlighted Features

  • Wildcard support for batch operations
  • Recursive directory tree support
  • Stream support as compression/inflation data sources or destinations
  • Span to multiple disks and split to multiple files on the same disk
  • Self-extracting executables
  • Integrates with Visual Studio 2005, 2008, 2010, 2012
  • NET Framework 4 Client Profile compatible
  • Many sample projects for both C# and VB.NET, as well as ASP.NET included

Zip Compression for .NET's sample projects >

 

  • 2 Components/Major Classes.
  • 6 Full Sample projects (in VB.NET, C#, ASP.NET, and Delphi 8).
  • Full MS Help 2.0 Documentation, including extensive examples and tutorials.
  • Free Introductory Support. 
Class Description
Archive Component This represents a collection of archive items and provides a standard Collection interface for manipulating the items in the collection. In addition, it provides the operations for data compression and decompression at the collection and item level.
ArchiveItem Class This represents a single file or stream containing compressed or uncompressed data.

  

Supported Environments

All PowerTCP for .NET components and classes will operate on any Microsoft operating system that fully supports the Microsoft .NET Framework, including 64-bit Windows. .NET components are dependent on the Framework rather than a specific operating system. Products support .NET Framework versions 2.0, 3.0, 3.5, 4.0, 4.5, 4.6 and 4.7. The components can be used with any .NET compliant language, including the following languages:

  • C#
  • VB.NET
  • Managed C++

 

PowerTCP for .NET components have been tested in the following application environments:

  • Standard Windows desktop applications
  • Console applications
  • ASP.NET web applications and Web Sites
  • Windows service applications
  • Web service applications

  

PowerTCP for .NET components have been tested in the following development environments:

  • Visual Studio .NET (2005, 2008, 2010, 2012, 2013, 2015)

  

 

 

PowerTCP for .NET components do not currently support execution within Silverlight. If you are interested in using Dart products within your Silverlight solution, contact support@dart.com for more options.

 

Code Examples

These code snippets can be copied and pasted into your project. 

Code Snippet Description
Compress A Folder Demonstrates how zip the contents of a folder with progress.
Decompress A Zip File Demonstrates how to unzip a zip file with progress.
Encrypt Memory Streams Demonstrates how to zip/unzip and encrypt/decrypt data in memory.
Self-Extracting File Demonstrates how to create a self-extracting zip file.

 

 

Sample Projects Included

The samples are fully working applications in C#, VB.NET, ASP.NET, and Delphi 8 and include complete source code. 

Sample Name Sample Description Languages
FolderArchive Demonstrates compressing multiple directories. VB.NET, C#
StreamArchive Demonstrates compressing and decompressing data in memory. VB.NET, C#
Streams Demonstrates compressing and decompressing streaming data. VB.NET, C#
Unzipper Demonstrates unzipping scenarios. VB.NET, C#
WebArchive Demonstrates usage in ASP.NET VB.NET, C# (ASP.NET)
ZipManager Manages compressed files similar to WinZip VB.NET, C#
Zipper Demonstrates zipping scenarios. VB.NET, C#

 

 

Product Release History

The following is a list of public releases for all components shipped with PowerTCP Zip Compression for .NET (Latest Release 2010-08-05) 

 

PowerTCP Zip Compression for .NET

   Current Version: 2.1.0.2

 

 

2.1.0.2   Released: 2010-08-05


 

  • The self-extraction feature has been enhanced in a number of ways. First, it is now possible to direct the self-extraction to occur as soon as the file is opened (without need of user input). Second, a "silent" mode can be used, in which the extraction occurs automatically and no UI is presented to the user. Finally, it is now possible to specify a file to open immediately after extraction.
  • Zip Compression for .NET now supports .NET Framework 4 Client Profile.
  • Zip Compression for .NET has been updated with VS 2010 integration.

 

Product fixes in this release:

  • Fixed the default value of the ExcludePattern property, which caused an error in some cases. (4884)
  • Archive now checks for a data descriptor when bit 3 is set to general flags. (4930)
  • Fixed an extraction issue when an AES 256 file was of a certain length. (4933)
  • Added better support for Unicode characters. (4958)
  • When a filename exceeds the system limit, an error is now correctly raised to the user. (4993)
  • Extracting a non-first file before the first file is extracted in a spanned archive no longer results in an error. (5000)
  • Uppercase 'Z' is now permitted in spanned file extensions. (5001)
  • Increased performance by decreasing time in which garbage collection is forced. (5025)
  • Fixed an issue with extracting spanned archives that have very small parts. (5068)
  • Fixed an issue with unzipping some very large files. (5168)
  • Providing an invalid standard encryption password now gives a more descriptive invalid password error. (5170)
  • Trying to extract a file with an incorrect password no longer creates a 0 byte file. (5272)
  • Writing directly to a Stream using Archive.Write has been fixed. (5331)

 

 

2.0.2.3   Released: 2008-11-14


 

  • The new Archive.Delimiter property can be set when adding multiple sources to an archive with a single Add call. Perhaps more importantly, this also permits the adding of files and paths with commas, by changing from the default value of ",".

 

Product fixes in this release:

  • A "Spanning cannot be used with self-extracting files" exception no longer occurs when a VS.NET 2005 or 2008 project is run after the Archive component is dragged onto a form. (4626)
  • Setting the archive Comment now works when using QuickZip. (4662)
  • Unzipping an archive that consists solely of an AES-encrypted 0 byte file no longer results in an error. (4721)
  • Files within an archive with Unicode names are now extracted correctly. (4722)
  • Zipping an opened file to a filename with differently cased letters no longer results in an error. (4736)
  • If an archive item decompressed to a stream, the stream is no longer closed if the Archive component is cleared. (4741)
  • Fixed an infinite loop issue that could occur if decompression was attempted on some malformed zip archives. (4760)
  • Zipping a 0 byte file using AES encryption now creates an archive that can be unzipped by other unzipping utilities. (4763)
  • Overwrite now works when it is passed in as a parameter of the Zip method. (4769)

 

 

2.0.1.0   Released: 2008-03-06


 

Product fixes in this release:

  • In VS.NET 2005+, the Archive component no longer throws a "Spanning cannot be used with self-extracting files" error after placing it on a form and building with default values. (4626)

 

Why Buy PowerTCP Zip Compression for .NET?

PowerTCP Zip Compression for .NET features compared with .NET Framework 4.0 (Visual Studio 2010)

 

Feature Visual Studio Zip Compression for .NET
Produces standard zip files compatible with WinZip and PKZIP -
Unzips standard zip archives including Windows compressed folders -
Reduces size of already-compressed files, such as jpg and mp3 -
Handles files greater than 4 GB in size -
Encrypts files with AES (128, 192, 256) or standard zip encryption -
Includes multiple compression/performance levels -
Generates self-extracting archives -
Creates spanned and split archives -
Updates user on progress of compression or decompression -

Zip Archive .NET Component

Use the Archive component within the .NET Framework to compress, decompress, and encrypt files and streams.

The Archive component provides both high-level ease of use for those developers who just want to write code as quickly as possible, and low-level power for those developers who require finer control. Features include:

  • Quickly compress a single file (or multiple files using wildcards...including recursive directory trees) with a single line of code.
  • Quickly decompress files with only a single line of code.
  • Compress to or from files or streams.
  • Customize the level of compression (high, medium, or low) based on your speed and size requirements.
  • Encrypt the output data using standard zip encryption.
  • Create a self-extracting zip file.
  • Supports spanning.
  • Manipulate the files in the archive on a global level (i.e. unzip all files at once, assign a comment to all files at once, etc) or on a file level (i.e. unzip a single file contained in the archive, assign the comment on a single file in the archive, etc).
  • C#, VB.NET, ASP.NET, and Delphi .NET sample projects included.
  • Integrates with Visual Studio 2005, 2008, 2010, 2012
  • .NET Framework 4 Client Profile compatible

 

 

Looking for the ActiveX version of this component?

 

 

Interface

 

Public Constructors
Archive Overloaded. Initialize a new instance of the Archive class.
Public Properties
Comment Gets or sets the comment for the entire collection.
CompressionLevel Gets or sets the compression level for data compression.
ContainsListCollection Gets a value indicating whether the collection is a collection of IList objects.
Count Gets the number of ArchiveItem objects within the Archive.
DefaultCompressionMethod Gets or sets the default compression algorithm used for data compression.
DefaultEncryption Gets or sets the encryption algorithm used for the the entire collection.
ExcludePattern Gets or sets the files to exclude when using wildcards.
Format Gets the file format used for the archive file.
IncludeSubs Gets or sets whether subdirectories are included when using wildcards.
IsSynchronized Gets a value indicating whether access to the ICollection is synchronized (thread-safe).
Item Gets or sets the object at the specified index.
Overwrite Gets or sets a value which determines how files are overwritten when decompressing files.
Password Gets or sets the encryption password for the entire archive.
PreservePath Gets or sets a value which determines if file paths are preserved when creating a compressed archive.
ProgressSize Gets or sets the frequency to raise the Progress event.
SelfExtractConfiguration Gets or sets a SelfExtractConfiguration object, which is used to define the specification of a self-extraction operation.
SpanConfiguration Gets or sets a SpanConfiguration object, which is used to span or split an archive over several volumes.
SyncRoot Gets an object that can be used to synchronize access to the Archive.
Tag Gets or sets an object reference that can be used to associate this instance with any other.
TempFileDirectory Gets or sets a value inidicating the directory to store any temp files created during compression operations.
VolumeLabel Gets or sets the volume label
Public Methods
Abort Abort the current operation
Add Add a file or multiple files to the archive.
BeginQuickUnzip Asynchronously load a compressed stream and unzip in one step.
BeginQuickZip Asynchronously add a file or files and zip in one step.
BeginUnzip Asynchronously decompress the items in the current collection to the specified directory
BeginZip Asynchronously compress the items in the current collection and generate a zip archive that is written to a Stream.
Clear Removes all elements from the ArrayList.
CopyTo Copies the entire ArrayList to a compatible one-dimensional Array, starting at the specified index of the target array.
GetEnumerator Returns an enumerator for the collection.
GetList Returns an IList that can be bound to a data source from an object that does not implement an IList itself.
Insert Insert one or more files into the collection starting from the specified index.
Open Opens a compressed file and populates the Archive collection to reflect the items in the compressed file.
QuickUnzip Open a compressed file archive and uncompress in one step.
QuickZip Add a file or files and compress in one step where the destination is a Stream.
RemoveAt Removes the element at the specified index of the collection.
RemoveRange Removes a range of elements from the ArrayList.
Reset Remove the elements in the collection and reset all of the properties of the collection to their defaults.
Unzip Decompress the items in the current collection to the specified directory
Zip Compress the items in the current collection and generate a zip archive to the destination stream
Public Events
BusyChanged This event is raised when the Busy property in the Archive component gets changed.
Disk This event is raised when a new removable media volume is needed during a spanning process.
EndUnzip This event is raised when an asynchronous Unzip operation completes
EndZip This event is raised when an asynchronous zip operation completes
Exception This event is raised when an Exception condition occurs during an Archive-level operation.
Progress This event is raised periodically to indicate the progress of the current compression or decompression activity.
SpanProgress This event is raised periodically to indicate the progress of a spanning operation.

 

 

Code Example

This example demonstrates compressing several files into a single zipped file.

 

VB.NET Example
' Add some files to the archive
Archive1.Add("C:\temp\file1.txt")
Archive1.Add("C:\temp\file2.txt")
Archive1.Add("C:\temp\file3.txt")

' Compress them
Archive1.Zip("C:\temp\archive.zip")

Compress Folder Code Example

The following example demonstrates compression of a folder using the Archive component. The archive is AES 256 encrypted. Progress is provided during the operation.

 

private void buttonZip_Click(object sender, EventArgs e)
{
    try
    {
        //Encrypt the zip file using AES 256.
        archive1.DefaultEncryption = Dart.PowerTCP.Zip.Encryption.Aes256Bit;
        archive1.Password = "321!thisIsMyPassword";

        //Add a folder to the zip file.
        //Include subfolders, preserve paths, and do not include txt files.
        archive1.IncludeSubs = true;
        archive1.PreservePath = true;
        archive1.ExcludePattern = "*.txt";
        archive1.Add("c:\\MyFiles\\*");

        //Create the zip file.
        archive1.Zip("c:\\MyArchive\\myZipFile.zip");
    }
    catch (Exception ex)
    {
        //Display message if operation encounters an error.
        textWarnings.AppendText("Error: " + ex.Message + Environment.NewLine);
    }
}

private void archive1_Progress(object sender, Dart.PowerTCP.Zip.ProgressEventArgs e)
{
    //Show zip progress for each item in the folder.
    progressItem.Maximum = 100;
    double itemPercent = ((double)e.ProcessedItemBytes / (double)e.Item.Size) * 100;
    progressItem.Value = Convert.ToInt16(itemPercent);

    //Show zip progress for the entire folder.
    progressTotal.Maximum = 100;
    double totalPercent = ((double)e.ProcessedTotalBytes / (double)e.TotalBytes) * 100;
    progressTotal.Value = Convert.ToInt16(totalPercent);
}

private void archive1_Exception(object sender, Dart.PowerTCP.Zip.ExceptionEventArgs e)
{
    //Display any warnings that occur during the operation.
    textWarnings.AppendText("Warning: " + archive1[e.Index].Name + " - " +
        e.Exception.Message + Environment.NewLine);
}

 

Decompress Zip File Code Example

The following example demonstrates decompression of a zip file using the Archive component. The archive is AES 256 encrypted. Progress is provided during the operation.

 

private void buttonUnzip_Click(object sender, EventArgs e)
{
    try
    {
        //Open a zip file to decompress.
        archive1.Open("c:\\MyArchive\\myZipFile.zip");

        //Decrypt the zip file using AES 256.
        archive1.DefaultEncryption = Dart.PowerTCP.Zip.Encryption.Aes256Bit;
        archive1.Password = "321!thisIsMyPassword";

        //Decompress the file, preserving paths.
        archive1.PreservePath = true;
        archive1.Unzip("c:\\MyFiles");
    }
    catch (Exception ex)
    {
        //Display message if operation encounters an error.
        textWarnings.AppendText("Error: " + ex.Message + Environment.NewLine);
    }
}

private void archive1_Progress(object sender, Dart.PowerTCP.Zip.ProgressEventArgs e)
{
    //Show zip progress for each item in the folder.
    progressItem.Maximum = 100;
    double itemPercent = ((double)e.ProcessedItemBytes / (double)e.Item.Size) * 100;
    progressItem.Value = Convert.ToInt16(itemPercent);

    //Show zip progress for the entire folder.
    progressTotal.Maximum = 100;
    double totalPercent = ((double)e.ProcessedTotalBytes / (double)e.TotalBytes) * 100;
    progressTotal.Value = Convert.ToInt16(totalPercent);
}

private void archive1_Exception(object sender, Dart.PowerTCP.Zip.ExceptionEventArgs e)
{
    //Display any warnings that occur during the operation.
    textWarnings.AppendText("Warning: " + archive1[e.Index].Name + " - " +
    e.Exception.Message + Environment.NewLine);
}

Encrypt Memory Streams Code Example

The following example demonstrates compression and AES encryption of data in memory by utilizing the Stream interface of the archive component.

 

private void buttonTest_Click(object sender, EventArgs e)
{
    //Test the encrypt and decrypt functions with a simple data string.
    string data = "Hello, this is my data to be encrypted!";
    string encryptedData = encrypt(data, "pass123!");
    string decryptedData = decrypt(encryptedData, "pass123!");
    MessageBox.Show("Original Data: " + decryptedData + Environment.NewLine +
        "Processed Data: " + decryptedData);
}

private string encrypt(string data, string password)
{
    //Write the data to a stream.
    byte[] buffer = System.Text.Encoding.Default.GetBytes(data);
    MemoryStream source = new MemoryStream(buffer);
    source.Position = 0;

    //Encrypt the data using AES 256.
    archive1.DefaultEncryption = Dart.PowerTCP.Zip.Encryption.Aes256Bit;
    archive1.Password = password;

    //Add the data to the archive.
    archive1.Clear();
    archive1.Add(source);

    //Compress and encrypt the data to a stream.
    MemoryStream result = new MemoryStream();
    archive1.Zip(result);

    //Read the stream to a buffer.
    result.Position = 0;
    buffer = new byte[result.Length];
    result.Read(buffer, 0, buffer.Length);

    //Return compressed and encrypted data as a string.
    //Note that smaller strings (with fewer than approx 200 bytes)
    //will not result in smaller strings due to zip overhead.
    return System.Text.Encoding.Default.GetString(buffer);
}

private string decrypt(string data, string password)
{
    //Write the data to a stream.
    byte[] buffer = System.Text.Encoding.Default.GetBytes(data);
    MemoryStream source = new MemoryStream(buffer);
    source.Position = 0;

    //Decrypt the data using AES 256.
    archive1.DefaultEncryption = Dart.PowerTCP.Zip.Encryption.Aes256Bit;
    archive1.Password = password;

    //Open the compressed and encrypted data in the archive.
    archive1.Clear();
    archive1.Open(source);

    //Decompress and decrypt data to a stream.
    MemoryStream result = new MemoryStream();
    archive1[0].Unzip(result);

    //Read the stream to a buffer.
    result.Position = 0;
    buffer = new byte[result.Length];
    result.Read(buffer, 0, buffer.Length);

    //Return decompressed and decrypted data as a string.
    return System.Text.Encoding.Default.GetString(buffer);
}

Self-Extracting File Code Example

The following example demonstrates creation of a self-extracting file using the Archive component.

 

private void buttonCreateSelfExtract_Click(object sender, EventArgs e)
{
    try
    {
        //Add a folder to the zip file.
        //Include subfolders and preserve paths.
        archive1.IncludeSubs = true;
        archive1.PreservePath = true;
        archive1.Add("c:\\MyFiles\\*");

        //Set the self-extract parameters.
        archive1.SelfExtractConfiguration = new SelfExtractConfiguration();
        archive1.SelfExtractConfiguration.CodePage = archive1.Encoding.CodePage;
        archive1.SelfExtractConfiguration.Caption = "My Self-Extracting File";
        archive1.SelfExtractConfiguration.Behavior = SelfExtractBehavior.UserInteractive;

        //No extracted file opened after archive is unzipped.
        archive1.SelfExtractConfiguration.FileToExecute = "";

        //Default overwrite behavior (can be changed by user).
        archive1.SelfExtractConfiguration.Overwrite = Overwrite.Always;
        archive1.SelfExtractConfiguration.EnableOverwrite = true;

        //Paths are preserved (cannot be changed by user).
        archive1.SelfExtractConfiguration.PreservePath = true;
        archive1.SelfExtractConfiguration.EnablePreservePath = false;

        //Path to archive to (can be changed by user).
        archive1.SelfExtractConfiguration.Path = "c:\\YourFiles";
        archive1.SelfExtractConfiguration.EnablePath = true;

        //Create the zip file.
        archive1.Zip("c:\\MyArchive\\mySelfExtractingFile.exe");
    }
    catch (Exception ex)
    {
        //Display message if operation encounters an error.
        textWarnings.AppendText("Error: " + ex.Message + Environment.NewLine);
    }
}

private void archive1_Exception(object sender, Dart.PowerTCP.Zip.ExceptionEventArgs e)
{
    //Display any warnings that occur during the operation.
    textWarnings.AppendText("Warning: " + archive1[e.Index].Name + " - " +
    e.Exception.Message + Environment.NewLine);
}

Archiving Directories

Problem:

The developer is faced with the challenge of saving space by archiving directories. The application must:

 

  • Zip folders with the option of including sub-folders
  • Split archives into multiple files
  • Span archives over multiple disks
  • Specify the size of the split or spanned parts

 

 

 

 

Solution:

With the PowerTCP Archive component, applications can perform all these tasks and more. The Folder Archive sample demonstrates how to synchronously or asynchronously create directory archives, with the option of splitting or spanning archives into several parts.

 

Download the Folder Archive Sample Now!

 

Download PowerTCP Zip Compression for .NET Trial

Compressing Data in Memory Using Streams

Problem:

The developer is faced with the challenge of compressing and decompressing data in memory. The application must:

 

  • Compress data in memory without using files on disk
  • Open and zip file data to compressed memory streams
  • Deflate compressed memory to files or streams
  • Add and remove data streams within a zip archive

 

 

 

Solution:

With the PowerTCP Archive component, applications can perform all these tasks and more. The Stream Archive sample demonstrates how to compress and deflate data in memory without the need to save to files on disk.

 

Download the Stream Archive Sample Now!

 

Download PowerTCP Zip Compression for .NET Trial

Zipping and Unzipping Streaming Data

Problem:

The developer is faced with the challenge of compressing and deflating streaming data as it is written and read. The application must:

  • Compress data "on-the-fly" as it is written in real-time
  • Deflate data as it is read in real-time
  • Encrypt and decrypt secure data streams
  • Display progress as the data is written or read

 

 

 

 

 

Solution:

With the PowerTCP Archive component, applications can perform all these tasks and more. The Streams sample demonstrates how to zip and unzip data "on-the-fly" as it is written to and read from data streams.

 

Download the Streams Sample Now!

 

Selecting and Unzipping Files

Problem:

The developer is faced with the task of simply permitting users to open and decompress zip files. The application must:

 

  • Select and open zip files for decompression
  • Select the destination directory of the archived files
  • Preserve folder structure or extract to a flat directory
  • Overwrite or skip existing files
  • Present progress of individual files and the archive as a whole

 

 

 

Solution:

With the PowerTCP Archive component, applications can perform all these tasks and more. The Unzipper sample demonstrates how to open and extract zip files to the specifications of the user.

 

Download the Unzipper Sample Now!

 

Download PowerTCP Zip Compression for .NET Trial

Zipping Files to an Archive

Problem:

The developer is faced with the task of adding files to a zip archive and compressing them. The application must:

  • Add and remove files from the archive
  • Zip the files to a selected location on disk
  • Present compression and attribute information for the files in the archive
  • Optionally preserve the paths of files as they are added
  • Provide encryption and compression level options
  • Present progress as the files are compressed

 

 

 

Solution:

With the PowerTCP Archive component, applications can perform all these tasks and more. The Zipper sample demonstrates how to add files and zip them to a file archive.

 

Download the Zipper Sample Now!

 

Purchase Options

Customize your product and support options match your needs. Discounts are applied when products are purchased in multiples or within available product suites.

$0.00 discount
 
$449.00

Have any questions about purchasing? See our Sales FAQ