Accéder au ZIP protégé ZIP archives offer a convenient way to compress multiple files for easy sharing over digital platforms. However, there are instances when a ZIP file containing sensitive information is accidentally sent to unintended recipients. Therefore, the capability to encrypt and decrypt files in compliance with industry standards is essential in any ZIP library. IronZIP stands out by enabling users to decrypt protected ZIP files with just a few lines of code, and it also allows the encryption of existing ZIP archives using passwords and various encryption methods. This versatility makes it suitable for a wide range of situations. Access Protected ZIP with C# using IronZip; using IronZip.Enum; using (var archive = new IronZipArchive("existing.zip", "P@ssw0rd")) archive.Encrypt("P@ssw0rd", EncryptionMethods.AES256); Accessing Protected ZIP Archive We first import the namespace IronZip. Afterward, we initialize a new IronZipArchive, and then we input two parameters, the first one being the path to the protected ZIP you're trying to access and the second being the password to access the protected ZIP. Do note that if the password or the path is incorrect, the operation will fail. Once the correct password is provided, the ZIP file can be decrypted, and its contents can be viewed, extracted, or modified. Encrypting the Existing ZIP Archive Aside from accessing the protected ZIP with the IronZipArchive class, IronZIP also allows you to encrypt the archive with a chosen encryption. To do this, we first import the IronZip.Enum , importing the enums will enable developers to select the encryption method used to encrypt the archive. Finally, we call the Encrypt method with two parameters passed in. The first one is the password that you wish to use to encrypt the ZIP Archive, while the second one is the EncrpytionMethods enum. Within this example, we will be using EncryptionMethods.AES256 to encrypt the file. After encrypting the file, you can confirm the operation by providing the password to access the protected ZIP again to verify. For a complete list of supported encryption methods and their related enums, please refer here. Learn to Create, Read & Extract ZIP Files with IronZip Liens de documentation associés Voir sur Github Tutoriel connexe Guide pratique connexe Documentation de classe Télécharger IronZIP DLL Signaler un problème sur cette page Prêt à commencer? Nuget Téléchargements 16,000 | Version : 2025.11 vient de sortir Téléchargement gratuit NuGet Total des téléchargements :16,000 Voir Licences
Testez dans un environnement en direct Testez en production sans filigranes.Fonctionne où que vous en ayez besoin.
Produit entièrement fonctionnel Profitez de 30 jours de produit entièrement fonctionnel.Configurez-le et faites-le fonctionner en quelques minutes.
Testez dans un environnement en direct Testez en production sans filigranes.Fonctionne où que vous en ayez besoin.
Produit entièrement fonctionnel Profitez de 30 jours de produit entièrement fonctionnel.Configurez-le et faites-le fonctionner en quelques minutes.