Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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()

Posted
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!
  • Administrators
Posted
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.

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...