1.开启进程

using System.Diagnostics;

ProcessStartInfo process = new ProcessStartInfo();
process.FileName = "要开启的进程路径"; 
string arg1 =  "进程参数1";
string arg2 =  "进程参数2";
process.Arguments = string.Format("{0} {1}", arg1, arg2) ;  //多个参数用空格隔开
process.WindowStyle = ProcessWindowStyle.Normal;
Process.Start(process);

2.修改要开启进程的Main函数

/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main(string[] args)   //这里的 args 就为 {arg1,arg2} 了
{
   Application.EnableVisualStyles();
   Application.SetCompatibleTextRenderingDefault(false);
   Application.Run(new Form1(args));
}

 

相关文章:

  • 2021-10-01
  • 2022-12-23
  • 2021-04-22
  • 2022-12-23
  • 2022-01-18
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-08-11
  • 2022-12-23
  • 2022-12-23
  • 2021-05-21
  • 2021-11-11
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案