private void button1_Click(object sender, EventArgs e)
{
  Process process = new Process();
  //process.StartInfo.WorkingDirectory = "c:\\GetName.exe";//EXE觉得路劲
  process.StartInfo.FileName = "GetName.exe";//同路劲下的EXE
  process.StartInfo.Arguments = "5";//传入的参数


  //UseShellExecute表示是否从控制台启动。如果想从标准输出流中读取输出,这个属性必需设为False

  //若要使用 StandardOutput,必须将 ProcessStartInfo.UseShellExecute 设置为 false,并且将ProcessStartInfo.RedirectStandardOutput 设置为 true

  process.StartInfo.UseShellExecute = false;


  process.StartInfo.CreateNoWindow = true;//不显示窗口
  process.Start();//启动
}

 

相关文章:

  • 2022-12-23
  • 2021-08-12
  • 2021-06-28
  • 2021-06-09
  • 2022-01-05
  • 2021-07-27
  • 2022-12-23
猜你喜欢
  • 2021-12-06
  • 2022-12-23
  • 2022-12-23
  • 2021-12-11
  • 2022-01-29
  • 2022-12-23
相关资源
相似解决方案