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. }