参数我想通过这就是为什么我用类似呼叫Winzip32.exe用C#
public void DoWinzip(string zipName, string password, string folderName)
{
ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.FileName = "C:\\Program Files\\WinZip\\winzip32.exe";
startInfo.Arguments = string.Format("-min -eZ {0} {1}", zipName, folderName);
try
{
// Start the process with the info we specified.
// Call WaitForExit and then the using statement will close.
using (Process exeProcess = Process.Start(startInfo))
{
exeProcess.WaitForExit();
}
}
catch(Exception ex)
{
// Log error.
}
}
但是,这会给我喜欢WinZip的参数验证错误,错误我的控制台应用程序的zip文件夹中。我错在哪里?
Update
我拼写错了-eZ其实可能-ex等......但另一个问题是winzip打开自己的窗口。我为它写了 - 但是它打开了。
为什么不用SharpZipLib(http://www.icsharpcode.net/opensource/sharpziplib/)?然后你完全控制了压缩过程。 – 2012-02-25 13:41:18
我这样做没问题,但它提供了比WinZip更大的MB大小的zip文件 – 2012-02-25 13:44:28