# IronZIP > The C# Zip Archive Library. Create, read, and extract archives in .NET applications. Add archive management functionality at ease. Supports .NET Framework. A single-file summary of the IronZIP documentation: 20 pages, each as its own abstract, so a model can read the documentation in one pass rather than fetching every URL. Blog posts are not included — see https://ironsoftware.com/zip/csharp/llms.txt for the link index, and https://ironsoftware.com/zip/csharp/llms-full-catalog.txt for one that covers the blog too. ## Getting Started ### Applying License Keys to IronZIP Archives in .NET 10 https://ironsoftware.com/zip/csharp/get-started/license-keys/ The article "Applying Software License Keys to C# Zip Archives | IronZIP" provides a comprehensive guide on how to apply IronZIP license keys for deploying projects without restrictions or watermarks. It begins by instructing users to download the latest IronZIP version from the official website. The next step involves applying the license key, which can be done through code at the application's startup or by integrating the key into Web.Config or App.Config files for global application use. The article warns of a known issue with IronZIP versions released before 2024.3.3, where keys in Web.config are not recognized for certain projects like ASP.NET and .NET Framework versions 4.6.2 and above, directing users to a troubleshooting guide. For .NET Core applications, the key can be added to an appsettings.json file. The article emphasizes verifying the license key using the IsLicensed property and offers code snippets for validation. Finally, it encourages users to follow a comprehensive tutorial to get started with IronZIP and suggests visiting the IronZIP section on their website for additional resources. For support or inquiries, users are advised to contact IronZIP support. ## Tutorials ### C# Create, Read, Extract Zip Tutorial | IronZIP https://ironsoftware.com/zip/csharp/tutorials/create-read-extract-zip/ The article "C# Create, Read, Extract Zip for .NET | IronZIP" from Iron Software provides a comprehensive guide on managing ZIP files using C#. The tutorial begins by explaining how to create a new ZIP archive. This involves selecting files or directories, specifying compression settings, and generating the archive using the `IronZipArchive` class. Users can add files to the archive with the `Add` method and finalize it with the `SaveAs` method. For existing ZIP files, the tutorial covers accessing contents through the `Read ZIP` function, allowing specific file extraction. The `ExtractArchiveToDirectory` method is highlighted for extracting files to a specified location. Moreover, the article explains modifying ZIP archives by adding more files to them, a task easily accomplished by opening the archive and using the `Add` method. The tutorial also briefly mentions that IronZip's techniques can be adapted to other compression formats like TAR, GZIP, and BZIP2 using their respective classes. This makes IronZip a versatile tool for developers looking to manage archives effectively in their C# projects. ## Code Examples ### Code Example: Access Protected ZIP | IronZip https://ironsoftware.com/zip/csharp/examples/access-protected-zip/ The article from IronZip provides a comprehensive guide on accessing and manipulating password-protected ZIP files using IronZip, a C# library that supports AES128 and AES256 encryption. To work with these secured ZIP archives, the correct password must be specified during initialization. The example code demonstrates how to open a ZIP file using the IronZIP.ZipArchive class by providing the file path and password. The available operations include viewing the entries within the archive, adding new files to it, and exporting a modified version of the ZIP file. The process involves iterating over each entry to list its name, adding an external file (e.g., "newfile.txt") to the archive, and saving the changes as a new ZIP file. The example illustrates robust error handling by catching exceptions that may arise during processing, thereby ensuring smooth operations. The article also provides links to related documentation and resources for further learning and troubleshooting. Overall, IronZip offers an efficient solution for managing password-protected ZIP files in C#, with a focus on ease of access and manipulation of secured data. ### Code Examples: Add Files to TAR Archive | IronZIP https://ironsoftware.com/zip/csharp/examples/add-files-to-tar/ The article on IronZIP's website provides a detailed guide on how to add files to a TAR archive using IronZIP in C# projects. IronZIP is a robust tool that allows developers to open existing TAR files, modify them by adding new files, and then export these modified archives. The process begins with the `FromFile` method, which opens the targeted archive. To incorporate new files, developers use the `Add` method, which simplifies the updating of archives. After modifying the archive, the `SaveAs` method facilitates exporting the updated TAR file to a new location. The article includes a practical code example illustrating these steps, where an existing TAR file is accessed, a new file is added, and the modified archive is saved as a new TAR file. The code ensures that paths to both the existing and new TAR files are correctly defined, and it highlights the importance of having the IronZIP library properly integrated into the C# project. This guide is instrumental for developers looking to efficiently manage and expand their TAR archives within their applications. ### Code Examples: Add Files to ZIP | IronZIP https://ironsoftware.com/zip/csharp/examples/add-files-to-zip/ IronZIP provides functionality to modify existing ZIP files within C# projects, allowing users to update and expand their ZIP archives to meet evolving project requirements. The process begins by utilizing the FromFile method to access the targeted ZIP archive. Once opened, the Add method facilitates the inclusion of new files into the existing archive. Finally, the SaveAs method is used to export the modified ZIP file. This streamlined approach simplifies archive management, making it efficient for developers to handle ZIP files in their applications. The article provides a sample C# code demonstrating the modification of a ZIP file using IronZIP. It includes namespace inclusion for access to necessary classes and methods, a main function for execution, and variable setup for specifying the paths to the existing ZIP file and the file to be added. The ZIP archive is loaded via IronZip.FromFile, and the specified file is added using zipArchive.Add. The modified archive is saved to a designated path using zipArchive.SaveAs. A success message is printed upon completion. This feature is detailed with related documentation links, tutorials, and how-to guides for further assistance. ### Code Examples: Create BZIP2 | IronZip https://ironsoftware.com/zip/csharp/examples/create-bzip2/ The article titled "Code Examples: Create BZIP2 | IronZip" from Iron Software provides a comprehensive overview of using the BZIP2 compression utility, particularly in Unix and Linux systems. BZIP2, known for its high compression efficiency, reduces file sizes effectively, resulting in '.bz2' extensions. It is especially efficient in compressing text data and offers relatively fast decompression. However, BZIP2 is not a file archiver and is designed to compress single files only. The article includes a practical Python code snippet that demonstrates how to use BZIP2 for file compression. The code involves importing the bz2 module, specifying input and output file paths, reading the input file in binary mode, and writing the compressed data to a new BZIP2 file. A completion message confirms the successful compression. The article emphasizes that this method is intended for single-file compression, not for multiple files or directories. Users are advised to ensure the input file exists and is readable before running the script. The article also provides links to related documentation and guides to further assist users in utilizing IronZip effectively. ### Code Example: Create GZIP | IronZip https://ironsoftware.com/zip/csharp/examples/create-gzip/ The article from Iron Software titled "Code Example: Create GZIP | IronZip" provides a detailed example of using a C# class to create GZIP files for efficient file compression and storage. GZIP, short for 'GNU Zip', is a widely used file compression utility, particularly in Unix and Linux systems, for reducing file sizes to save storage space and enable faster data transmission. The document describes how individual files can be compressed into GZIP format, which bears a '.gz' extension, and further explains creating compressed archives by combining multiple files into a single TAR file before compressing it into a GZIP archive, resulting in extensions like '.tar.gz' or '.tgz'. The article presents a conceptual example using a hypothetical IronGZipArchive class in C#. This class implements IDisposable for resource management and features an Add method to include TAR files in the GZIP archive and a SaveAs method to save the archive with a '.gz' extension. The example underscores the importance of using the 'using' statement in C# to ensure resources are properly disposed of after the archive creation is complete. The article also includes related documentation and resources for further reading and download. ### Code Example: Create TAR | IronZIP https://ironsoftware.com/zip/csharp/examples/create-tar/ The article on IronZIP's website provides a guide for creating TAR files using a fictional library, IronTarArchive, which is not part of the standard libraries in Unix and Linux systems. TAR, short for 'Tape Archive,' is a format used for bundling multiple files and directories into a single archive without compression, while preserving file structure and metadata. Typically, TAR is combined with compression tools like gzip or bzip2 for tasks such as data backups and software distribution. The guide outlines the process of creating a TAR file using an IronTarArchive object, which includes creating an empty TAR file, adding files or directories using a hypothetical Add method, and saving the final archive with a SaveAs method. The article emphasizes that these methods are illustrative, and in actual practice, standard libraries like Python's tarfile should be used. Additionally, it provides a code example and explanation for importing the IronTarArchive class, creating a TAR archive instance, adding files and directories, and saving the archive. The website also offers links to related documentation, tutorials, and downloads for IronZIP DLL, with an option to report issues. ### Code Example: Create ZIP | IronZip https://ironsoftware.com/zip/csharp/examples/create-zip/ The article from IronZip provides a detailed guide on how to create ZIP archives using C#. ZIP is a popular file compression format that reduces file sizes for efficient storage and transmission by combining multiple files and directories into a single archive. This tutorial explains how to implement ZIP file creation using the System.IO.Compression namespace in C#. The process begins with specifying the directory or file paths to be compressed, followed by opening a FileStream for the ZIP file in Create mode. A ZipArchive is then instantiated using this file stream, and files from the specified directory are added to the archive. This is achieved by iterating through each file in the directory, extracting the file name, and using the CreateEntryFromFile method to add it to the archive. The tutorial emphasizes ensuring proper permissions for accessing directories and notes that existing files at the specified ZIP path will be overwritten. Additionally, the page provides links to related documentation, tutorials, and resources for further reference. A message confirming the successful creation of the ZIP archive is output upon completion of the process. ### Code Example: Extract BZIP2 | IronZip https://ironsoftware.com/zip/csharp/examples/extract-bzip2/ IronZip offers an efficient solution for extracting BZIP2 files through its static ExtractArchiveToDirectory method, part of the IronBZip2Archive class. BZIP2, known as Burrows-Wheeler Block Sort Text Compressor, is a widely-used file compression utility in Unix and Linux systems, particularly effective for compressing individual text files. To extract files from a BZIP2 archive using C#, developers need to specify the BZIP2 file path and the target extraction directory. The method efficiently handles the removal of the .bz2 extension during the extraction process. Sample C# code demonstrates the straightforward implementation: after specifying the file path and destination directory, the ExtractArchiveToDirectory method is called to perform the extraction, followed by a console message confirming successful extraction. Developers must ensure that 'IronBZip2.dll' is included in the project and should manage any exceptions that may arise during extraction. Additionally, similar VB.NET code is provided to cater to developers using that language. This robust solution simplifies the extraction of BZIP2 archives, making it an invaluable tool for software projects requiring compression and decompression functionalities. ### Code Example: Extract GZIP | IronZip https://ironsoftware.com/zip/csharp/examples/extract-gzip/ The article titled "Code Example: Extract GZIP | IronZip" on Iron Software's website provides a detailed explanation of how to extract GZIP files using the IronZip library. GZIP, commonly associated with the TGZ file format (or "tarball"), combines multiple files into a single archive, compressed with GZIP compression. The article focuses on using the ExtractTGZArchiveToDirectory method from the IronGZipArchive class to extract the contents of a TGZ file. A code example is provided to demonstrate the process: a TGZ file named 'output.tgz' is extracted to a directory called 'extracted_content'. This example is written in both C# and VB.NET, illustrating the necessary steps, such as referencing the IronGZip library, declaring variables for file paths, and creating an IronGZipArchive instance. The ExtractTGZArchiveToDirectory method is then used to perform the extraction, with a console message indicating the completion of the process and the location of the extracted files. The article also includes additional resources like related documentation, tutorials, and guides, offering a comprehensive understanding of GZIP extraction with IronZip. ### Code Example: Extract Protected ZIP | IronZip https://ironsoftware.com/zip/csharp/examples/extract-protected-zip/ The article titled "Code Example: Extract Protected ZIP | IronZip" provides a comprehensive guide on extracting protected ZIP archives using the IronZip library, which supports AES128 and AES256 encryption. To extract a protected ZIP file, users must specify the correct password using the `Password` parameter within the `ExtractArchiveToDirectory` method and designate both the ZIP file location and the extraction directory. The guide includes a practical example in C#, demonstrating how to use IronZip to efficiently extract a protected ZIP archive. The example involves including the IronZip namespace and setting up the main method to define the ZIP file path, extraction directory, and the password. It then calls the `ExtractArchiveToDirectory` method, which initializes a `ZipArchive` instance with the specified file path, sets the password, and extracts the contents to the specified directory. A confirmation message is printed upon successful extraction. The article also highlights the importance of ensuring the accuracy of file paths and passwords to reflect the user's actual setup. Additional resources, such as related documentation and links to GitHub, are provided for further exploration and troubleshooting. ### Code Example: Extract TAR | IronZIP https://ironsoftware.com/zip/csharp/examples/extract-tar/ The article titled "Code Example: Extract TAR | IronZIP" on Iron Software's website provides a comprehensive guide on extracting TAR files using the IronZIP library. TAR files, typically used with GZIP and BZIP2 for compression, function as file archivers without inherent compression. The guide introduces the `ExtractArchiveToDirectory` method of the `IronTarArchive` class to facilitate this process. A sample C# console application code snippet is provided, demonstrating the creation of an `IronTarArchive` instance for extracting files from a specified TAR archive into a chosen directory. The code features essential error handling through try-catch blocks, ensuring any issues such as file not found errors or inaccessible directories are managed gracefully. The application accepts command-line arguments, requiring users to specify the TAR file path and the destination directory for extraction. Key aspects include incorporating the IronZIP library into the project and leveraging the `IronTarArchive` class's capabilities. The article emphasizes the importance of error handling and proper command-line argument management for effective TAR file extraction. The page also offers links to related documentation, tutorials, and the option to download the IronZIP DLL for further exploration and integration. ### Code Example: Extract ZIP | IronZip https://ironsoftware.com/zip/csharp/examples/extract-zip/ The article titled "Code Example: Extract ZIP | IronZip" provides a detailed guide on efficiently extracting ZIP files using the IronZip library's 'ExtractArchiveToDirectory' method. ZIP is a widely-used file compression and archiving format that facilitates reduced file sizes for optimal storage and transmission, commonly employed for data backup, software distribution, and file sharing. The article explains how to extract files from a ZIP archive by specifying the location of the ZIP file and the directory for file extraction using the 'ExtractArchiveToDirectory' method. It includes a code example demonstrating the process in C# and Visual Basic, utilizing the System.IO.Compression namespace to access the ZipFile class, which offers static methods for managing ZIP archives. The code is structured with a try-catch block to handle any potential exceptions such as file path issues or access permissions. The example script extracts files from a ZIP archive located at "C:\example\myArchive.zip" and places them into the "C:\example\extractedFiles" directory, with instructions to adjust paths as needed. The article also provides links to related documentation, tutorials, and resources for further guidance on using IronZip. ### Code Example: Password Protect ZIP | IronZip https://ironsoftware.com/zip/csharp/examples/password-protect-zip/ The article "Code Example: Password Protect ZIP | IronZip" provides a detailed guide on how to create password-protected ZIP files using Python. Password protection is crucial for securing the contents of a ZIP archive, ensuring only authorized users with the correct password can access the files. The example utilizes Python's zipfile module, which supports traditional password encryption. However, the standard library does not provide built-in support for setting passwords directly. Instead, third-party libraries like pyminizip or pyzipper are recommended for this purpose. Pyzipper is particularly noted for supporting AES encryption, offering stronger security through AES-128 and AES-256 methods, though these require compatible extractors such as WinRAR or 7-Zip. The article includes a basic Python script to create a ZIP archive, emphasizing the need for additional libraries to achieve advanced encryption capabilities. This resource serves as a foundational template for developers looking to implement secure ZIP file encryption in their applications. For more complex security needs, readers are directed to consider third-party tools and libraries. Additional resources and documentation links are provided for further exploration and troubleshooting. ### Code Example: View Archive Entries | IronZip https://ironsoftware.com/zip/csharp/examples/view-archive-entries/ The article on IronZip's website provides a code example illustrating how to view entries within a ZIP archive file without extracting them. The example demonstrates how to open an existing archive by passing its file path to the IronZipArchive constructor, and then calling the Entries() method to retrieve a List of the entries inside the archive. The code iterates over this list, printing each entry's Name to the console, thus allowing users to preview the contents of the archive without extraction. The Entry class also exposes other properties such as Size, Version, and Comment for deeper inspection. Additionally, the page offers links to related documentation, tutorials, and the IronZip DLL download, providing further resources for users interested in archive file manipulation. ## Troubleshooting ### Engineering Request​ - IronZIP https://ironsoftware.com/zip/csharp/troubleshooting/engineering-request-zip/ IronZIP encourages users to submit engineering support requests to help improve their product and address technical challenges. The process is collaborative, viewing software development as a dialogue between customers and developers. To effectively address issues, the Iron Software team requires detailed and concise information to replicate problems and create regression tests, as many issues are platform or runtime-specific. Support requests should be emailed to support@ironsoftware.com, accompanied by a clear technical report. The report should include a description of the symptoms, log files, environment details (such as IronZIP version, OS, and .NET runtime version), and any cloud environment specifics. To prioritize requests, users should provide an example project that reproduces the issue, a Stack Overflow-style code snippet, screenshots, exception messages, debugging points, and input parameters like URLs or files. The preferred example project format is a zipped, standalone .NET console or web app project, which facilitates swift issue recognition by engineers. Users must ensure full sharing permissions when using file-sharing services like Google Drive or Dropbox and exclude the bin folder to avoid bloating the zip file. Including both working and non-working input files, such as PDFs and images, is also recommended. ### IronZIP File and Archive Size Limits https://ironsoftware.com/zip/csharp/troubleshooting/file-and-archive-size-limits/ IronZIP provides comprehensive support for the ZIP64 standard, allowing users to create, read, and extract ZIP archives without being restricted by the traditional 4GB file size and 65,535-entry limits of the original ZIP format. With ZIP64, IronZIP automatically lifts these limitations, enabling handling of files up to approximately 18 exabytes, archives of the same magnitude, and more than 4 billion entries per archive. However, the actual performance is influenced by factors such as system memory, file system type, application architecture, and disk I/O performance. For optimal functionality, it is recommended to operate applications as 64-bit processes, utilize NTFS or exFAT file systems for large files, and stream files to minimize memory usage. IronZIP is compatible with both Windows and Linux environments and supports .NET 6, 7, 8, and .NET Framework, ensuring a robust solution for handling extensive ZIP operations without needing to manually activate ZIP64 support. These features make IronZIP a versatile and powerful tool for managing large-scale archive operations efficiently. ### Setting License Key in Web.config | IronZIP https://ironsoftware.com/zip/csharp/troubleshooting/license-key-web.config/ The article "Setting License Key in Web.config | IronZIP" from Iron Software provides a detailed guide on configuring an IronZip license key within a web application's Web.config file. This is crucial for ensuring that web applications using IronZip are properly licensed, especially for versions before 2024.3.3, where a known licensing issue exists. For ASP.NET projects and .NET Framework versions 4.6.2 and above, there is a specific problem where the license key is not automatically picked up from the Web.config file. To resolve this, the article suggests a workaround that involves manually retrieving the license key using the ConfigurationManager class in the code. The provided example demonstrates how to add the license key in the appSettings section of Web.config and then use C# code to fetch and assign this key to the IronZip.License.LicenseKey property. This method ensures that the license is applied correctly, preventing any unhandled licensing exceptions. The article also highlights the importance of using proper directives and provides a code example to assist developers in successfully implementing this workaround and verifying that the license key has been set correctly. ## Product Updates ### IronZIP Product Updates | IronZIP https://ironsoftware.com/zip/csharp/product-updates/changelog/ IronZIP, a comprehensive ZIP archive management toolkit for .NET projects, is committed to providing engineers with a robust and reliable solution for handling ZIP files. The changelog reveals their focus on community feedback and continuous innovation. Recent updates throughout 2024 and 2025 largely involve minor bug fixes, ensuring enhanced stability and performance for users. Noteworthy releases include version 2025.1.1 in January 2025, which addressed known security vulnerabilities by updating dependency packages. Earlier, in March 2024, version 2024.3.3 introduced substantial enhancements like support for multiple saves of ZIP archives and added functionalities such as replacing entries and removing encryption. Additionally, significant method renaming and feature additions were made to streamline operations. The January 2024 release, version 2024.1.1, brought encryption algorithms for enhanced archive protection and introduced new classes and methods for improved functionality. The initial launch in October 2023, version 2023.11.2, marked the introduction of key features like compressing and decompressing various file formats, including zip, tar, gzip, and bzip2. IronZIP's roadmap emphasizes a collaborative approach with its user community, ensuring the toolkit evolves to meet the dynamic needs of developers in the .NET ecosystem.