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

Getting Started

Important

The Universal Subscription or an additional Document Server Subscription is required to use this example in production code. Please refer to the DevExpress Subscription page for pricing information.

To get started with a Compression library, perform the following steps.

  1. Create a new Windows Forms Application project.
  2. Add reference to the DevExpress.Docs.v17.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 17.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