========请教各路大侠,如何通过程序来压缩文件。。。。。 顶者有分这是关系到底层的应用问题,请大侠指教啊。。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 使用外部调用程序,调用rar.exe就行,当然前提是要有这个rar.exe先 msdn上有篇文章讲压缩的,楼主可以去看一下。 http://community.csdn.net/Expert/topic/4208/4208649.xml?temp=.5379602不知道是不是你想要的,看看吧! 在程序里面调用winrar等的命令行调用方式就可以了!! http://blog.csdn.net/cityhunter172/我有篇文章专讲压缩与解压 string Strdir = DirectoryName;//要压缩的文件夹string StrdirGoal = Strdir + "\\" + "exam";//压缩包存放位置string StrCmd = "a " + " -ep1 -sfx " + StrdirGoal + " " + Strdir;string StrRARCmd = Server.MapPath( "" ) + "\\Rar\\Rar.exe ";Process.Start( StrRARCmd, StrCmd );你把压缩文件考到wwwroot....只需要四个文件就可以了而且可以压缩文件夹,自动解压。等等。 string readRoot = @"C:\";string filePath = @"C:\files.rar";string unZipFolder = @"C:\files\";//调用程序WinRAR进行解压System.Diagnostics.Process process = new System.Diagnostics.Process();//设置执行文件物理存放目录process.StartInfo.FileName = readRoot + "WinRAR.exe";process.StartInfo.Arguments = " x -inul -y " + filePath + " " + unZipFolder;//进行解压process.Start(); //等待解压的完成while(!process.HasExited) {} 一个GridView导出到Excel中的问题 数据库连接池 新手弱问:为什么asp.net2.0无法执行? 存储过程问题,急!!! 请问新闻系统文章标题的问题 ASP.NET中怎么把动态页面转换为静态页面? wj2929(*ヤRěйヤ*)你快来呀!我又碰到排版的问题了!!! 请问怎么在列标题里加小图片。 求购网站和电子政务!!!! MVC跨控制器Controller访问\调用\跳转,问题请教 RadioButtonList绑定数据库中的一个表,当我选择其中一项时,如何向数据库中插入选中的那个文本??谢谢啊~~ 上传判断
string StrdirGoal = Strdir + "\\" + "exam";//压缩包存放位置
string StrCmd = "a " + " -ep1 -sfx " + StrdirGoal + " " + Strdir;
string StrRARCmd = Server.MapPath( "" ) + "\\Rar\\Rar.exe ";
Process.Start( StrRARCmd, StrCmd );
你把压缩文件考到wwwroot....
只需要四个文件就可以了
而且可以压缩文件夹,自动解压。等等。
string filePath = @"C:\files.rar";
string unZipFolder = @"C:\files\";
//调用程序WinRAR进行解压
System.Diagnostics.Process process = new System.Diagnostics.Process();
//设置执行文件物理存放目录
process.StartInfo.FileName = readRoot + "WinRAR.exe";
process.StartInfo.Arguments = " x -inul -y " + filePath + " " + unZipFolder;
//进行解压
process.Start();
//等待解压的完成
while(!process.HasExited)
{
}