.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+
The page you are viewing does not exist in the .NET Standard 2.0+ platform documentation. This link will take you to the parent topic of the current section.
A newer version of this page is available. Switch to the current version.

Get Started - Create a ZIP Archive

IMPORTANT

You require a license to the DevExpress Office File API or DevExpress Universal Subscription to use these examples in production code. Refer to the DevExpress Subscription page for pricing information.

To get started with a Zip Compression and Archive API, perform the following steps.

  1. Create a new Windows Forms Application project.
  2. Add reference to the DevExpress.Docs.v19.1.dll library.
  3. Create a method containing the code listed below.

    
    using DevExpress.Compression;
    // ...
    string zipFileName = "Test.zip";
    string sourceDir = @"C:\Users\Public\Documents\DevExpress Demos 18.2\Components\Data";
    string password = "123";
    EncryptionType encryptionType = EncryptionType.PkZip;
    using (ZipArchive archive = new ZipArchive())
    {
        archive.Password = password;
        archive.EncryptionType = encryptionType;
        archive.AddDirectory(sourceDir);
        archive.Save(zipFileName);
    }
    
  4. Run the project and execute the method. It creates the Test.zip archive with all files encrypted using “123” password.
See Also