How to bundle files into one?

ppsa

Member
Joined
Sep 28, 2008
Messages
13
Programming Experience
10+
I've developed a VB.net windows forms application that writes and reads data to/from 3 xml files. Those files--not the application--need to be portable; users need to be able to put them on a USB drive, for example, and take them to another location (web app is not possible in this case). To avoid requiring my users to make sure they copy all 3 files, I'd like to be able to package the three files into one file so that they have only 1 file to deal with. They are all different xml schemas so I can't merge them. I'm looking for some kind of wrapper or packager than can bundle the 3 files into one in a way that my vb.net app can open that file and then open any one of the 3 files in it, use them, save them back, etc... Does anyone know of a way to do this?

Many thanks!
 
Thanks for the reply! Can I open the zip file and access the files in it without having to extract them to disk?
 
The ZIP functionality in the System.IO.Packaging namespace is rather cumbersome because it is intended for use in deployment scenarios, not for application development. If you can use .NET 4.5 then you can use the far more friendly ZIP functionality in the System.IO.Compression namespace. If you must use an older Framework version then I'd suggest using a third-party tool, e.g. SharpZipLib or DotNetZip.
Thanks for the reply! Can I open the zip file and access the files in it without having to extract them to disk?
It's a ZIP file, just like any other ZIP file. You can use it just like any other ZIP file. If you mean in your application code then yes, you can extract the data from the ZIP file to memory and use it in your application.
 
If you can use .NET 4.5 then you can use the far more friendly ZIP functionality in the System.IO.Compression namespace.
The additions in Compression namespace for .Net 4.5 is welcome and looks easy to use, I wasn't aware of them.
 
Back
Top