Looking for c# Keywords? Try Ask4Keywords

C# Language Запись в 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("========================");
        }
    }
}