尝试提取 zip 文件时出现错误:
c:\path\name.zip 不是 RAR 压缩包
没有要解压的文件
我的代码是:
p.StartInfo.FileName = @"C:\Program Files\WinRAR\rar.exe";
p.StartInfo.Arguments = string.Format("x -o- {2} \"{0}\" * \"{1}\"\\ ",
szFN,
outFolder,
passWord == null ? "" : string.Format("-p\"{0}\"", passWord));
GUI 版本可以提取 zip 和 7z 文件。
为什么这不起作用?如何提取 zip 和 7z 文件?
(注意:我有不同的 7zip 源代码。我想我可以将两者合并,并且仅在文件具有 rar 扩展名时使用上述源代码。但我不喜欢那个解决方案。)