C# 简单方式解压Zip文件/使用VS2019自带功能
生活随笔
收集整理的這篇文章主要介紹了
C# 简单方式解压Zip文件/使用VS2019自带功能
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
一、目的、構想
1.直接解壓zip文檔。
2.網上資料不少需要外部dll。
3. 找到可以不需要外部dll方法,分享。
?
二、code實現
?
using System.IO.Compression;string filePath = @"c:\Server\fileList"; string zipPath = @"C:\Server\Download\Auto.zip"; string extractPath = @"C:\Server\test"; ZipFile.CreateFromDirectory(filePath , zipPath); //將整個文件夾壓縮為ZIP文件 ZipFile.ExtractToDirectory(zipPath, extractPath); //解壓ZIP文件到extrat目錄中。?
總結
以上是生活随笔為你收集整理的C# 简单方式解压Zip文件/使用VS2019自带功能的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: C# 简单方式运行powershell文
- 下一篇: C# 检查当前系统已安装的程序app/两