原始调用第三方程序方法
System.Diagnostics.Process.Start(@"..\test.exe");
问题
在主程序中打开第三方应用程序,第三方应用程序的相对路径错误(一般都是将主程序启动路径作为了第三方程序的相对路径参照路径)
解决方案
在启动第三方程序前将启动程序的工作路径设置正确
var testpath = @"..\test.exe";
System.Diagnostics.Process process = new System.Diagnostics.Process();
process.StartInfo.FileName = testpath ;
//指定第三方程序工作路径
process.StartInfo.WorkingDirectory = Path.GetDirectoryName(testpath);
process.Start();