我有一个app.exe应用程序要求输入输入路径字符串,一旦我输入,它会询问输出路径字符串...现在当我输入时,app .exe执行一些操作
我需要从我的窗体应用程序传递这些路径 我看到很多这样的问题,但无法实现我的要求,因为我从未使用过程和Stream Reader或Writer 任何帮助请...示例将被感谢..谢谢..
string input = @"C:\Documents and Settings\pankaj\Desktop\My File\greetingsfreinds.ppt";
string output = @"C:\Documents and Settings\pankaj\Desktop\test";
Process process = new Process();
process.StartInfo.FileName = @"C:\Program Files\Wondershare\MyApp\app.exe";
process.StartInfo.UseShellExecute = false;
process.StartInfo.CreateNoWindow = false;
process.StartInfo.RedirectStandardInput = true;
process.Start();
process.WaitForExit(3000);
process.Close();
string input = @"C:\Documents and Settings\pankaj\Desktop\My File\greetingsfreinds.ppt";
string output = @"C:\Documents and Settings\pankaj\Desktop\test";
Process process = new Process();
process.StartInfo.FileName = @"C:\Program Files\Wondershare\MyApp\app.exe";
process.StartInfo.UseShellExecute = false;
process.StartInfo.CreateNoWindow = false;
process.StartInfo.RedirectStandardInput = true;
process.StartInfo.Arguments = input + ";" + output;
process.Start();
string Strout = process.StandardOutput.ReadToEnd();
process.WaitForExit();
process.Close();
答案 0 :(得分:6)
您可以使用ProcessStartInfo.Arguments。
Process process = new Process()
process.StartInfo.FileName = @"C:\Program Files\Wondershare\MyApp\app.exe";
process.StartInfo.UseShellExecute = false;
....
process.Arguments = input + " " + output;