System.Diagnostics.Process 运行完需要按一个键 不然程序就挂起了.该如何处理

System.Diagnostics.Process 运行完需要按一个键 不然程序就挂起了..
我在控制台程序里调用了另一个控制台程序(不是我自己写的 print2flash3)
print2flash执行完了会

无论是设置地不显示窗口还是隐藏模式什么的, 最终程序都会被挂起, 就像这样
我要不按个键, 我的程序就被停在这了!


按了键以后我的程序就运行成功了






  System.Diagnostics.Process pss = new System.Diagnostics.Process();
  try
  {
  pss.StartInfo.CreateNoWindow = true;
pss.StartInfo.FileName = app;
pss.StartInfo.Arguments = string.Format("{0} {1}",sourcePath, swfPath);
pss.Start();

  while (!pss.HasExited)  
  {
  continue;
  }

  }
  catch (Exception ex)
  {
  return false;
  }
  finally 
  {
  pss.Close();
  pss.Dispose();
  }

------解决方案--------------------
碉堡了,这都用



while (!pss.HasExited)
{
continue;
}
----------------------------------------

他等你按键

var standartInput = pss.StandardInput;
standartInput.AutoFlush = true;
standartInput.WriteLine("y");
standartInput.Close();