需要下载ICSharpCode.SharpZipLib.dll using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.IO; using ICSharpCode.SharpZipLib.Checksums; using ICSharpCode.SharpZipLib.Zip; using ICS
今天过中秋节,当地时间(2013-09-08),公司也放假了,正好也闲着没事,就在网上学习学习,找找资料什么的.最近项目上可能会用到压缩的功能,所以自己就先在网上学习了,发现一个不错的用于压缩的DLL文件,并且免费,而且开放源码: 这就是我今天介绍的对象: SharpZipLib 我们先看看它的官方介绍吧: #ziplib (SharpZipLib, formerly NZipLib) is a Zip, GZip, Tar and BZip2 library written entirely
首先通过NuGet管理安装ICSharpCode.SharpZipLib.dll 以下是压缩的通用方法: using System; using System.IO; using System.Web; using System.Linq; using System.Collections.Generic; using ICSharpCode.SharpZipLib.Zip; namespace Common { /// <summary> /// 压缩文件帮助类 /// </summa
#ZipLib is a Zip, GZip, Tar and BZip2 library written entirely in C# for the .NET platform. It is implemented as an assembly (installable in the GAC), and thus can easily be incorporated into other projects (in any .NET language).#ZipLib was ported f
using System; using System.Collections.Generic; using System.IO; using System.Text; using ICSharpCode.SharpZipLib.Checksums; using ICSharpCode.SharpZipLib.Zip; namespace Tools { public class SharpZipHelper { /// <summary> /// 存放待压缩的文件的绝对路径 /// </
public class ZipFileHelper { List<string> urls = new List<string>(); void Director(string dir) { DirectoryInfo d = new DirectoryInfo(dir); FileSystemInfo[] fsinfos = d.GetFileSystemInfos(); foreach (FileSystemInfo fsinfo in fsinfos) { if (fsin
问题描述:在项目中需要将文件压缩然后传输给三方进行彩信发送,使用SharpZipLib 进行压缩,原先使用J#进行压缩处理,但是用SharpZipLib压缩后的zip文件传输过去之后,总会报发送失败.最后在加入 s.UseZip64 = UseZip64.Off;这一句话后,解决问题.特此记录. using (ZipOutputStream s = new ZipOutputStream(File.Create(argZipPath))) { s.UseZip64 = UseZip64.Off;
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.IO; using ICSharpCode.SharpZipLib.Zip; using ICSharpCode.SharpZipLib.Checksums; using System.Runtime.InteropServices; namespace Common { /// <summary>