A fork of the DotNetZip project without signing with a solution that compiles cleanly. This project aims to follow semver to avoid versioning conflicts. DotNetZip is a FAST, FREE class library and toolset for manipulating zip files. Use VB, C# or any .NET language to easily create, extract, or update zip files.
There is no setup for DotNetZip.
Simply download the package from its site, decompress the library somewhere in your disk and set the reference from your project to the release folder appropriate for your project type. Remember to distribute the DLL with your application.
So I've been using the DotNetZip Library for some time now, and it works pretty well, up until yesterday when I maxed out the zipfile size. On any given day, I need to zip PDFs and transfer them to an SFTP site, that only accepts zip files. The amount of PDFs range from a couple hundred, a couple thousand to well over 10K. I had about 24K PDFs yesterday when the DotNetZip process broke. There is a way to split the zipfiles using the DotNetZip library but for some reason, the system that is being used on the SFTP server cant handle zipfiles that are split.
Title: Use the DotNetZip library to compress and decompress files in C#BackgroundNormally I don't like to require third-party libraries. I don't know what tools you have loaded on your system and I don't want to assume you can load new tools without creating conflicts. If third-party tools get out of synch, it can also be hard to upgrade appropriately to get them all working again.However, this tool seems worth adding to your toolkit. The .NET Framework comes with a System.IO.Compression.GZipStream class that lets you compress and decompress files. Unfortunately it works only with GZip files (with a .gz extension) not regular .zip files. You can open these files with many other third-party tools, but the Windows operating system doesn't let you browse them the way it does Zip files. (I don't see the logic in providing a way to make compressed files that the operating system can't read. Perhaps it's a licensing issue.)You can build true Zip files with the System.IO.Packaging namespace, but Microsoft has done a terrible job with it. It requires all sorts of strange URIs, resource and document parts, relationships, and running data through streams when you should just be able to add and remove objects. (It really seems like it was designed by someone who's never needed to do this in real life. Possibly the same people who designed WPF, particularly WPF bitmaps.)Installing DotNetZipThe DotNetZip library, which is free, provides .NET managed classes that you can use from C# to compress and decompress true Zip files. This example only shows a couple of the library's features.To use it, start a new project. In Solution Explorer, right-click on References and select Manage NuGet Packages. On the Browse tab, search for DotNetZip, click it, and then on the right click Install. I had to fiddle with this a bit to get it to install because it seemed confused about .NET Framework version. If you have problems, you may need to change the version that your project is targeting.To make using the library easier, add this using statement:using Ionic.Zip;
While past releases of Ionic were tightly coupled to Angular, version 4.x of the framework was re-engineered to work as a standalone Web Component library, with integrations for the latest JavaScript frameworks, like Angular. Ionic can be used in most frontend frameworks with success, including React and Vue, though some frameworks need a shim for full Web Component support.
One of the main goals with moving Ionic to Web Components was to remove any hard requirement on a single framework to host the components. This made it possible for the core components to work standalone in a web page with just a script tag. While working with frameworks can be great for larger teams and larger apps, it is now possible to use Ionic as a standalone library in a single page even in a context like WordPress.
Angular has always been at the center of what makes Ionic great. While the core components have been written to work as a standalone Web Component library, the @ionic/angular package makes integration with the Angular ecosystem a breeze. @ionic/angular includes all the functionality that Angular developers would expect coming from Ionic 2/3, and integrates with core Angular libraries, like the Angular router.
Ionic now has official support for the popular React library. Ionic React lets React developers use their existing web skills to build apps that target iOS, Android, and the web. With @ionic/react, you can use all the core Ionic components, but in a way that feels like using native React components.
Ionic now has official support for the popular Vue 3 library. Ionic Vue lets Vue developers use their existing web skills to build apps that target iOS, Android, and the web. With @ionic/vue, you can use all the core Ionic components, but in a way that feels like using native Vue components.
The CLR held by Revit is complex because all add-ins share the same AppDomain. You never know if there are any conflicts between your add-in and the others. Always adopt a strong-named third party library to avoid possible compatibility issues.
Nick,
Can you provide a full example of this with a backgroundWorker?
I have been looking for a working and so far, your sample is the only one I
have found that uses dotnetzip with 2 progress bars AND actually works.
Using the System.IO.Compression.GZipStream classes results in the dreaded DllNotFoundException: MonoPosixHelper exception ( -monoposixhelpersystem-io-compression-deflatestream), so until Unity 3.0 comes out and the later version of Mono it ships with supports a fully managed compression scheme, we have to rely on a third party compression library.
Some have reported that DotNetZip ( ) works with Unity. I keep receiving an "IBM437 codepage not supported" (or similar) error when trying to work with this library. It is a much better library than SharpZipLib from a usability perspective.
There is a mono compiled version of SharpZipLib that ships with Unity (as discussed in this forum post =10699&highlight=sharpziplib), which seems like a possibility. However, I am hesitant to use an older version of the library.
I went and tried the 3rd party library you are having trouble with: DotNetZip.I downloaded their distribution package, and grabbed Ionic.Zip.dll from it, and placed it into the Assets folder of an empty Unity2.6.1 project.
Have you tried looking at 7Zip? Has a completely managed C# library that I know works in Unity. It gives you compress/uncompress to and from memory streams/byte arrays, in LZMA format, so it's better than zip and actually what Unity uses to compress assets.
His bug demo code was still posted, so I grabbed the .dll from it and used it in my code. It WORKS! But, I won't immediately call this an acceptable answer to this question. This is the version of the library that ships with Unity (located here: Unity\Editor\Data\Frameworks\Mono.framework), so whatever bugfixes or improvements may have happened after this version was published, or may happen in the future, are lost to me.
This license governs use of the accompanying software, the DotNetZip library ("the software"). If you use the software, you accept this license. If you do not accept the license, do not use the software.
Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module.
The resulting Zip will contain File.txt, but it will be within the \My Documents\Sample\ hierarchy. There's no way to control the structure of the zip file when you add individual files, unless you want to modify the zip library (which is under MsPL license). That proved to be a big problem in my case, because the zip structure I'm creating is pretty rigid. So, if you're just zipping an entire folder full of files, this library may work for you, but if you need more control you may need to modify the library. I'm guessing if this were published on CodePlex it would have been fixed a while ago.
J# has included zip since day one, to keep compatible with the Java libraries. So, if you're willing to bundle the appropriate Java library (specifically, vjslib.dll), you can use the zip classes in java.util.zip. It works, but it seems like a really goofy hack to distribute a 3.6 MB DLL just to support zip.
In .NET 3.0, you can use the the System.IO.Packaging ZipPackage class in WindowsBase.DLL. It's just 1.1 MB, and it just seems to fit a lot better than importing Java libraries. It's not very straightforward, but it does work. The "not straightforward" part comes from the fact that this isn't a generic Zip implementation, it's a packaging library for formats like XPS that happen to use Zip.
You'll notice that the compression in my test is not that great. In fact, pretty bad - Notepad.exe got bigger. Binary files don't compress nearly as well as text-based files - for example, I tested on a 55KB file and it compressed to less than 1KB - but the compression in this library doesn't appear to be fully implemented yet. For example, the CompressionOption enum includes CompressionOption.Maximum, but that setting is ignored. Normal is the best you'll get right now.
The Microsoft .NET Framework base class library lacks a good set ofbuilt-in classes for creating and reading ZIP files, and Windows itselflacks full-powered built-in ZIP tools. DotNetZip fills those needs.
760c119bf3