65.9K
CodeProject is changing. Read more.
Home

File Compression with ZipForge .NET Library

starIcon
emptyStarIcon
starIcon
emptyStarIconemptyStarIconemptyStarIcon

1.87/5 (6 votes)

Dec 15, 2007

CPOL
viewsIcon

27712

downloadIcon

505

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