SIMIN Posted March 10, 2008 Posted March 10, 2008 Hello everyone here! I hope I will enjoy using the forum! OK my first post is a VB.NET request since I am confused at here. I just found a code snippet in MSDN which convert an input file to an output (ZIP GZ) file. It should be OK but I cannot figure it so it can accept multiple files as input and give me one single ZIP GZ output! Maybe a pro can help me! Dim SourceFile As FileStream = File.OpenRead(InPath) Dim DestinationFile As FileStream = File.Create(OutPath) Dim Buffer(SourceFile.Length) As Byte SourceFile.Read(Buffer, 0, Buffer.Length) Using Output As New GZipStream(DestinationFile, CompressionMode.Compress) Output.Write(Buffer, 0, Buffer.Length) End Using SourceFile.Close() DestinationFile.Close() Quote
Administrators PlausiblyDamp Posted March 10, 2008 Administrators Posted March 10, 2008 Are you wanting to create a zip file from code? i.e. A typical zip archive containing multiple files each of which can be extracted individually or just concatenate multiple files into one large single compressed block? Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
SIMIN Posted March 10, 2008 Author Posted March 10, 2008 I just want to add some files to a single output file for my personal use, I will use it for backup/restore of some of my application files! Quote
Administrators PlausiblyDamp Posted March 11, 2008 Administrators Posted March 11, 2008 IIRC the .Net built in support doesn't really give you the ability to store multiple separate files easily. You might want to look at http://www.icsharpcode.net/OpenSource/SharpZipLib/Download.aspx as they have a free zip library that makes it reasonably easy to do what you want. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.