读书人

用c#程序把文件做成压缩包该如何做

发布时间: 2012-01-06 22:55:18 作者: rapoo

用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 ");

读书人网 >C#

热点推荐