我想在一个WINDOWS应用程序下
通过
       private void button1_Click(object sender, EventArgs e)
        {
            string name;
            name = System.Windows.Forms.Application.ExecutablePath;//当前程序全路径
            System.Diagnostics.Process.Start(name);//执行程序
        }的形式再打开一个WINDOWS应用程序
同时向新打开的WINDOWS应用程序传递一个 str我应该怎么传递过去呢?            System.Diagnostics.Process.Start(name,str)
这样可以么?
最关键的问题是,
另外那个WINDOWS应用程序怎样才能接受到呢?
在        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Form1());
        }
里改么?

解决方案 »

  1.   

    MSDN上有详细的解释,看看吧;
      

  2.   

    static void Main(string[] args)
    args就是传入的参数。
      

  3.   

    static void Main()
            {
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                Application.Run(new Form1());
            }
    =>static void Main(object[] objs)
            {
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                Application.Run(new Form1(objes));
            }
      

  4.   

     System.Threading.Thread TheThread = new System.Threading.Thread(new System.Threading.ThreadStart(ASM_EXE));
                TheThread.Start();
               
    、、、、、、、、、、、、、、、、、、、、、、、、、、、、、
       private void ASM_EXE()
            {
                if (ExeCommand(ASM_Path, ref DealMess) < 0) //ASM_Path路径
                {
                    MessageBox.Show("测试程序失败!" + DealMess);
                    return;
                }
            }
    、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、 public static int ExeCommand(string commandText, ref string strOutput)
            {
                //进程传参数
                Process pro = new Process();
                pro.StartInfo.FileName = commandText;
                pro.StartInfo.Arguments = "mode0"; //传参数
                pro.Start();
                return 0;
            }
      

  5.   

    using System;
    using System.Collections.Generic;
    using System.Windows.Forms;namespace UpdateExe
    {
        static class Program
        {
            /// <summary>
            /// 应用程序的主入口点。
            /// </summary>
            [STAThread]
            static void Main(string[] args)
            {
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);            if (args.Length == 0)
                {
                    Application.Run(new Form1());
                }
                else
                {
                    Application.Run(new Form1(args[0]));
                }
            }
        }
    }
    //接收