调用C#自带的API进行压缩
//zip
destFullPath = destFullPath + "\\" + _myConfig.zipFileName;
if (File.Exists(destFullPath))
File.Delete(destFullPath);
ZipFile.CreateFromDirectory(_myConfig.tempFileFolder, destFullPath);
调用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)\\WinRAR\\winrar.exe";
/*
* a 添加文档,必须要有,否则不会输出压缩文件。
* -k 锁定压缩文件
* -r 包括子目录
* -m1 使用最快方式(低压缩)
* -ep1 排除基准文件夹,不然压缩包会包含待压缩文件夹所在的完整路径