如题!
主要是怎样接收exe程序返回的参数!!

解决方案 »

  1.   

    不知道这个帖子对你是否有用 gogogo
      

  2.   


    我那个EXE程序的主函数主要是这样,我想用另一个程序调用该程序生成的EXE并获取返回参数!!
            static int Main()
            {
                string savePath = "C:\\USBIsolatorFile";
                try
                {
                    Application.EnableVisualStyles();
                    Application.SetCompatibleTextRenderingDefault(false);
                    Application.Run(new MainForm(savePath));
                    if (Directory.GetFiles(savePath).Length > 0)
                    {
                        return 0;
                    }
                    else
                    {
                        return 1;
                    }            }
                catch (Exception ex)
                {
                    File.WriteAllText(Path.Combine(savePath,"error.log"), ex.Message);
                    return 2;
                }
            }
      

  3.   

    使用message,获取进程ID,然后两个exe进程之间进行发送消息
      

  4.   


    Process p = Process.Start("my.exe");
    p.WaitForExit();
    int exitCode = p.ExitCode;   //<--