Microsoft.Net has a very good utility for zipping aka packaging files. While there are good utilities there in open source/Code Plex for packaging files. I would still prefer to write the code using native functions and classes available in .Net. In this article I am going to use the System.IO.Packaging for showing how to attach multiple files into a zip.
I have created a separate class called as Zipper for the future works as it gives great re-usability. This class can be used for the WinForms, WPF, or ASP.Net applications. Though has to be changed as per the specific needs. It is just a starter for writing more functions into the zipper class.
Read original article here http://www.vbknowledgebase.com/?Id=156&Desc=Asp.Net-Zip-Multiple-Files
Zipper class for Packaging
Referencing required assemblies
The System.IO.Packaging library is not directly available in the default set of references. You have to add a reference to the assembly known as windowsbase.dll under Program Files. In my system it is located right at C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.0\WindowsBase.dll. Once it is referenced the namespace can be imported in the top of the class as Imports System.IO.Packaging.Read original article here http://www.vbknowledgebase.com/?Id=156&Desc=Asp.Net-Zip-Multiple-Files
0 comments:
Post a Comment