Skip to main content
A newer version of this page is available. .

Getting Started

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.v18.2.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