using System;
using System.IO.Compression;

using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;

namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
string path="D:\\20170605.txt" ;
using (ZipArchive newFile = ZipFile.Open(path, ZipArchiveMode.Create))
{
ZipArchiveEntry entry = newFile.CreateEntry("zipDemo.txt", CompressionLevel.Optimal);
using (var entryStream = entry.Open())
{
using (StreamWriter sw = new StreamWriter(entryStream))
{
sw.Write("123");
}
}
}
}
}
}

相关文章:

  • 2022-02-21
  • 2022-01-30
  • 2022-01-27
  • 2021-09-30
  • 2021-11-05
  • 2021-08-13
  • 2021-09-22
猜你喜欢
  • 2021-08-25
  • 2021-07-09
  • 2021-12-31
  • 2022-12-23
相关资源
相似解决方案