我正在使用第三方软件工具(命令行工具)将 PDF 文件合并在一起。我尝试使用 C#System.Diagnostics.Process
来运行可执行文件,但根据参数设置,我遇到了一些错误。
- 如果我得到
UseShellExecute = true
:RedirectStandardOutput = true
- Process 对象必须将
UseShellExecute
属性设置为false
才能重定向 IO 流。
- Process 对象必须将
- 如果我得到
UseShellExecute = true
:RedirectStandardOutput = false
- 该系统找不到指定的文件
- 如果我得到
useShellExecute = false
:RedirectStandardOutput = true
- 该系统找不到指定的文件
- 如果我得到
UseShellExecute = false
:RedirectStandardOutput = false
- 该系统找不到指定的文件
正在运行的代码如下:
Process p = new Process();
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardOutput = false;
p.StartInfo.WorkingDirectory = "C:\\Program Files (x86)\\VeryPDF PDF Split-Merge v3.0";
p.StartInfo.FileName = "pdfpg.exe " + strFileNames.Trim() + " "
+ D2P_Folder_Converted + "\\" + strOutputFileName;
p.Start();
p.WaitForExit();
p.Close();
p.Dispose();
有人可以帮我解决这个问题吗?