string arges = $"{GModel.UserId} {GModel.UserName} {oneChannel.channelId}{oneChannel.channelName}";//设定执行参数 一空个隔开,传入时间会自动 传入 string[]
System.Diagnostics.ProcessStartInfo pinfo = new System.Diagnostics.ProcessStartInfo();
pinfo.UseShellExecute = true;
//启动进程
System.Diagnostics.Process p = System.Diagnostics.Process.Start(Filepath, arges);///加入参数
读取方法如下:加入 程序入口
static void Main(string[] arge)
{
if (arge != null && arge.Length == 4)
{
GModel.UserId = arge[0];
GModel.UserName = arge[1];
GModel.ChannelId = arge[2];
GModel.ChannelName = arge[3];
}
else
{
GModel.UserId = "1";
GModel.UserName = "testUser";
GModel.ChannelId = "2";
GModel.ChannelName = "testChannel";
}
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new FrmMain());
}