Click here to Skip to main content
15,885,767 members
Articles / Programming Languages / C#
Article

File Compression with ZipForge .NET Library

Rate me:
Please Sign up or sign in to vote.
1.87/5 (6 votes)
15 Dec 2007CPOL 27.5K   10   1
File Compression with ZipForge .NET Library

Introduction

Compression and De-Compression with ZipForge ZipForge.NET Library, Supported IDEs include Microsoft Visual Studio 2003, 2005.

Background

ZipForge does more than just compress and decompress data. Lots of algorithms can be used to compress the data files. For ex: Ace128,Ace192,Ace256 etc. Creating and managing a zip file is easy.

Compression of the Files

Blocks of code should be set as style "Formatted" like this:

ComponentAce.Compression.ZipForge.ZipForge zip = new ComponentAce.Compression.ZipForge.ZipForge();
zip.EncryptionAlgorithm = ComponentAce.Compression.Archiver.EncryptionAlgorithm.Aes128;
zip.FileName = "C:\\Download\\test.zip";  
zip.Password = "satyarapelly";
zip.OpenArchive(System.IO.FileMode.Create);
foreach (string inputFileName in inputFileNames)
{
   zip.AddFiles(inputFileName);
}
zip.CloseArchive();

De-Compression of the Files

ComponentAce.Compression.ZipForge.ZipForge zip = new ComponentAce.Compression.ZipForge.ZipForge();
zip.FileName = "C:\\Download\\test.zip";  
if (System.IO.File.Exists(zip.FileName))
   zip.OpenArchive(System.IO.FileMode.Open);

zip.BaseDir = textBox4.Text;
zip.Password = textBox2.Text;
zip.ExtractFiles("*.*");
zip.CloseArchive();

by Satya Rapelly

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
infosys
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
GeneralLicence costs not explained!!! Pin
Ray Hayes15-Dec-07 11:40
Ray Hayes15-Dec-07 11:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.