ComponentOne Zip for .NET
Zip for .NET Task-Based Help / Compressing an Entire Folder into a Zip File
In This Topic
    Compressing an Entire Folder into a Zip File
    In This Topic

    To compress an entire folder into a zip file, preserving the folder structure for later expansion, use the AddFolder method.

    For example, to compress the contents of the "c:\temp" folder, including all subfolders, use the following code:

    To write code in Visual Basic

    Visual Basic
    Copy Code
    C1Zip.Entries.AddFolder("c:\temp\", "*.*", True)
    

    To write code in C#

    C#
    Copy Code
    C1Zip.Entries.AddFolder(@"c:\temp\", "*.*", true);
    

    To extract the folder later, including the original folder structure, use the following code:

    To write code in Visual Basic

    Visual Basic
    Copy Code
    C1Zip.Entries.ExtractFolder("c:\temp\")
    

    To write code in C#

    C#
    Copy Code
    C1Zip.Entries.ExtractFolder(@"c:\temp\");