调用winRAR进行压缩 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace testZIPEXE { class Program { static void Main(string[] args) { String exePath = "C:\\Program Files (x86)\\WinRA
因工作中要对数据打包,顺便研究了下WinRAR的命令行模式,自己写了些例子,基本用法如下: 测试压缩文件准备:文件夹test_data,内部包含子文件夹,分别存放了一些*.log和*.txt文件. 测试代码如下: rem 压缩全部文件,按类型压缩,zip打包 WinRAR.exe a num_all.zip .\test_data\ WinRAR.exe a num_txt.zip .\test_data\num*.txt WinRAR.exe a num_log.zip .\test_data
1,最简单的压缩命令:winrar a asdf.txt.rar asdf.txt a的意思是进行压缩动作,后面第一个参数是被压缩后的文件名,后缀当然是rar了,最后面 的参数就是要被压缩的文件名 2,最简单的解压缩命令:winrar e asdf.txt.rar e的意思是执行解压缩,解压缩的文件是后面这唯一的参数,但是这个e解压缩是把解出来的 文件释放到当前目录下面,与asdf.txt.rar文件并列了,因此,更加实用的是下面的带路径 解压缩. 3,带路径的解压缩命令:winrar x as