我正在使用 ProcessStartInfo 用这样的文本文件修补文件(通过 cmd.exe):
app.exe temp.txt patch.ips
我写了这段代码:
ProcessStartInfo P = new ProcessStartInfo("app.exe");
P.Arguments = "temp.txt " + _patchpath;
P.CreateNoWindow = true;
P.UseShellExecute = false;
P.RedirectStandardOutput = true;
Process.Start(P);
app.exe 和 temp.txt 是相对于我的应用程序路径的(注意:app.exe 不是我的 C# 应用程序的名称,它只是我用于进程的程序),但 _patchpath 是像 D 这样的绝对路径:\blah\file.ips。问题是,如果它是绝对的,则该过程不起作用(_patchpath 应该使用文件 temp.txt 进行修补),但如果它相对于我的应用程序目录则起作用。为什么会这样,我该如何解决?
如果我需要清楚,请告诉我。