【文件属性】:
文件名称:C#压缩解压
文件大小:81KB
文件格式:ZIP
更新时间:2017-07-04 04:14:24
C#压缩解压
.NET4.5及以上的平台压缩解压
引用下面两个DLL
C:\Windows\Microsoft.NET\Framework\v4.0.30319\System.IO.Compression.dll
C:\Windows\Microsoft.NET\Framework\v4.0.30319\System.IO.Compression.FileSystem.dll
//压缩目录到zip文件
ZipFile.CreateFromDirectory(startPath, zipPath);
//解压zip文件到指定目录
ZipFile.ExtractToDirectory(zipPath, extractPath);
单个文件就不说了
要是遇到 4.0及以下的版本,请使用下面这个
下载吧,少年
【文件预览】:
ICSharpCode.SharpZipLib.dll
ZipHelper.cs