我有一个aa.exe程序,现在要用别的程序调用它,调用时会给aa.exe传递一个参数ff
我再aa.exe的代码里如何获得传递进来的这个参数ff????

解决方案 »

  1.   

    Main() 和命令行参数
    http://msdn2.microsoft.com/zh-cn/library/acy3edy3(VS.80).aspx
      
    *****************************************************************************
    欢迎使用CSDN论坛专用阅读器 : CSDN Reader(附全部源代码) 
    http://feiyun0112.cnblogs.com/
      

  2.   

    遍历 System.Environment.GetCommandLineArgs()
      

  3.   


    Process p = new Process();
                p.StartInfo = new ProcessStartInfo();
                p.StartInfo.Arguments = "ff";
                p.Start();
      

  4.   

    获取可以用  foreach(string s in System.Environment.GetCommandLineArgs())
                {
                    MessageBox.Show(s);
                }
      

  5.   

     Process p = new Process();
                p.StartInfo = new ProcessStartInfo();
                p.StartInfo.Arguments = "ff";
                p.Name="bb.ext";
                p.Start();调用程序
    class Program
        {
            static void Main(string[] args)
            {
             string ff=args[0];
    }