Bodoconsult.Core.Tools.Zip 1.0.2

There is a newer version of this package available.
See the version list below for details.
dotnet add package Bodoconsult.Core.Tools.Zip --version 1.0.2                
NuGet\Install-Package Bodoconsult.Core.Tools.Zip -Version 1.0.2                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Bodoconsult.Core.Tools.Zip" Version="1.0.2" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Bodoconsult.Core.Tools.Zip --version 1.0.2                
#r "nuget: Bodoconsult.Core.Tools.Zip, 1.0.2"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Bodoconsult.Core.Tools.Zip as a Cake Addin
#addin nuget:?package=Bodoconsult.Core.Tools.Zip&version=1.0.2

// Install Bodoconsult.Core.Tools.Zip as a Cake Tool
#tool nuget:?package=Bodoconsult.Core.Tools.Zip&version=1.0.2                

What does the library

Bodoconsult.Core.Zip library simplifies the handling of ZIP files in C#. With the ZipHandler class you can add one or more files to a ZIP archive. With the UnZipHandler class you can unzipped the files contained in a ZIP archive.

How to use the library

The source code contain a NUnit test classes, the following source code is extracted from. The samples below show the most helpful use cases for the library.

Create a ZIP files

Use ZipHandler class to build a ZIP Archive from one or more files:

        var toZip1 = Path.Combine(TestHelper.TestDataPath, @"logo.jpg");
        var toZip2 = Path.Combine(TestHelper.TestDataPath, @"logo1.jpg");
		
        var zipFileName = Path.Combine(TestHelper.TempPath, @"zipFile3.zip");

        // Zip files with a password
        var zh = new ZipHandler(new[] { toZip1, toZip2 }, "Test123!");
        zh.GenerateZip(zipFileName);

Open an existing ZIP fileS

Use the UnZipHandler class to unzip the files contained in a ZIP archive:

        var zipFile = Path.Combine(TestHelper.TestDataPath, @"Rechnung_10.04.2019.zip");
        var targetPath = TestHelper.TempPath;

        var uh = new UnZipHandler(zipFile);
        foreach (var f in uh.Files)
        {
            var fileName = Path.Combine(targetPath, f.FileName);

            if (File.Exists(fileName)) File.Delete(fileName);

            // Get file data and save it
            var data = uh.GetFileData(f.Path);

            File.WriteAllBytes(fileName, data);
        }

About us

Bodoconsult http://www.bodoconsult.de is a Munich based software development company from Germany.

Robert Leisner is senior software developer at Bodoconsult. See his profile on http://www.bodoconsult.de/Curriculum_vitae_Robert_Leisner.pdf.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.3 304 12/20/2022
1.0.2 285 12/19/2022
1.0.0 437 10/29/2020

Migration to .NET 6 and updated dependencies