写入 zip 文件
要编写新的 .zip 文件:
System.IO.Compression
System.IO.Compression.FileSystem
using (FileStream zipToOpen = new FileStream(@"C:\temp", FileMode.Open))
{
using (ZipArchive archive = new ZipArchive(zipToOpen, ZipArchiveMode.Update))
{
ZipArchiveEntry readmeEntry = archive.CreateEntry("Readme.txt");
using (StreamWriter writer = new StreamWriter(readmeEntry.Open()))
{
writer.WriteLine("Information about this package.");
writer.WriteLine("========================");
}
}
}