12345678910111213141516171819202122232425262728 |
- using System;
- using System.Collections.Generic;
- using System.IO;
- using System.IO.Compression;
- using System.Text;
- namespace Bowin.Common.Utility
- {
- public class ZipHelper
- {
- public static void SaveZipFile(List<ZipFile> fileList, Stream stream)
- {
- using (var zipArchive = new ZipArchive(stream, ZipArchiveMode.Create))
- {
- fileList.ForEach(file =>
- {
- var zipArchiveEntry = zipArchive.CreateEntryFromFile(file.FilePath, file.FileName);
- });
- }
- }
- }
- public class ZipFile
- {
- public string FilePath { get; set; }
- public string FileName { get; set; }
- }
- }
|