zip压缩,解压

//引用 System.IO.Compression.FileSystem.dll




  var basePath = AppDomain.CurrentDomain.BaseDirectory;

            System.IO.Compression.ZipFile.CreateFromDirectory(basePath + @"\test", basePath+@"\test2.zip"); //压缩

            System.IO.Compression.ZipFile.ExtractToDirectory(basePath + @"\test2.zip", basePath + @"\test2"); //解压

 

posted @ 2021-11-12 15:43  212的s  阅读(33)  评论(0)    收藏  举报