.Net Framework 4.5 zip压缩原生支持
生活随笔
收集整理的這篇文章主要介紹了
.Net Framework 4.5 zip压缩原生支持
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
必須引用項目的 System.IO.Compression.FileSystem 程序集
using System.IO.Compression;
string startPath = @"c:\example\start";
string zipPath = @"c:\example\result.zip";
string extractPath = @"c:\example\extract";
//壓縮
ZipFile.CreateFromDirectory(startPath, zipPath);
//解壓
ZipFile.ExtractToDirectory(zipPath, extractPath);
總結
以上是生活随笔為你收集整理的.Net Framework 4.5 zip压缩原生支持的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: java开源项目-六个经典的 Sprin
- 下一篇: .Net System.Object类介