using System.IO.Compression;
public void ZipImages()
{
string zipCreatePath = System.Web.Hosting.HostingEnvironment.MapPath("/myZip.zip");
using(ZipArchive archive = ZipFile.Open(zipCreatePath, ZipArchiveMode.Create))
{
List<string> files = new List<string>();
files.Add("wallhaven-103536.jpg");
files.Add("wallhaven-161383.jpg");
files.Add("wallhaven-30764.jpg");
foreach(string file in files)
{
string filePath = System.Web.Hosting.HostingEnvironment.MapPath(string.Format("/images/{0}", file));
archive.CreateEntryFromFile(filePath, file);
}
}
}