如何从一个应用程序中启动外部应用程序(可能包含多个参数),外部程序怎样捕获是本身自己启动的还是被启动的,如何捉到参数?请哪位高手赐教??

解决方案 »

  1.   

    如何从一个应用程序中启动外部应用程序(可能包含多个参数),Process.Start("Application.exe", "Arguments");外部程序怎样捕获是本身自己启动的还是被启动的,
    一个程序本身是无法自己启动的,那样违背科学常理>_<~如何捉到参数?请哪位高手赐教??
    console application的MAIN中第2个参数就是参数表的指针,通过这个指针就能得到参数了
      

  2.   

    string path = @"C:\Documents and Settings\Administrator\桌面\启动外部程序\WindowsFormsApplication2\WindowsFormsApplication2\bin\Debug\WindowsFormsApplication2.exe";
            
                Process myprocess = new Process();
                ProcessStartInfo startInfo = new ProcessStartInfo(path);
                startInfo.Arguments = "arg1 arg2";
                myprocess.StartInfo = startInfo;
                myprocess.StartInfo.UseShellExecute = false;
                myprocess.Start();问题可以通过上面的方式解决,传递了两个参数,不过这种参数的传递方式总感觉不怎么安全啊