日期:2014-05-19  浏览次数:20806 次

用c#程序把文件做成压缩包该怎么做?
用c#程序把文件做成压缩包该怎么做?

------解决方案--------------------
你搜索一下ICSharpCode.SharpZipLib.dll
------解决方案--------------------
方法1
要引用ICSharpCode.SharpZipLib.dll

ICSharpCode.SharpZipLib.Zip.FastZip zip = new ICSharpCode.SharpZipLib.Zip.FastZip();
zip.CreateEmptyDirectories = true;
zip.CreateZip(BackPath + BackName + "\\ " + webname + ".zip ", WebPath + webname, true, null);
backwebmessage.InnerHtml = "成功备份 " + webname + "项目^_^ ";
方法2就是直接调用
System.Diagnostics.Process.Start( "rar.exe ", @ "a -inul -y c:\my.rar c:\myweb ");