Joe

Joe

  • NA
  • 22
  • 0

Using GzipStream to zip up more then one file

Dec 7 2009 12:30 PM
Most of the samples i been finding just relate to one file. What if I needed more then one file zip up.

 TextWriter wr;

for (int i = 0; i < 4; i++)
{
wr = File.CreateText(@"code\code" + i + ".txt");
wr.WriteLine("This would be a Text File");
wr.Flush();
wr.Close();
wr.Dispose();
}
//Zip up the files (counted 4 files total)
try
{

}
catch
{
// Couldn't compress.
}

How could I zip up all 4 text files and put them in all one zip file.

Joe


Answers (2)