CommandLine.exe -arg1 -arg2 -arg3 就可以了呀

解决方案 »

  1.   

    启动应用程序的时候添加
    例如你c盘下面的1.exe
    你cmd 输入 c:\1.exe -arg1 -arg2 -arg3
    然后就可以在程序的入口可以得到了
        public static void Main(string[] args) {}
      

  2.   


    回答错了 请指出? 难道不是这样传参的嘛? 
    在项目中有很多这样的例子都是这样应用,比如程序需要启用一个外部程序转换语音
    则可以调用// 压缩MP3
                  this.StartProcess(
                        Path.Combine(this.compressPath, "ffmpeg.exe"),
                        string.Format(@"-i {0} -ac 1 -ar 8000 -ab 7950 -y {1}",
                        args.Mp3FileFullName, args.Mp3FileCompressName));private void StartProcess(string fileName, string args)
            {
                Process process = Process.Start(new ProcessStartInfo
                {
                    FileName = fileName,
                    Arguments = args,
                    UseShellExecute = false,
                    RedirectStandardInput = false,
                    RedirectStandardOutput = false,
                    CreateNoWindow = true
                });            process.WaitForExit();
                process.Close();
            }
      

  3.   


    回答错了 请指出? 难道不是这样传参的嘛? 
    在项目中有很多这样的例子都是这样应用,比如程序需要启用一个外部程序转换语音
    则可以调用// 压缩MP3
                  this.StartProcess(
                        Path.Combine(this.compressPath, "ffmpeg.exe"),
                        string.Format(@"-i {0} -ac 1 -ar 8000 -ab 7950 -y {1}",
                        args.Mp3FileFullName, args.Mp3FileCompressName));private void StartProcess(string fileName, string args)
            {
                Process process = Process.Start(new ProcessStartInfo
                {
                    FileName = fileName,
                    Arguments = args,
                    UseShellExecute = false,
                    RedirectStandardInput = false,
                    RedirectStandardOutput = false,
                    CreateNoWindow = true
                });            process.WaitForExit();
                process.Close();
            }

    我只会6撸的方法 代码没传参没试过
      

  4.   

    编译完成后,运行cmd,将路径移至完成的编译文件夹下,例如cd X:xxx\xxx\dubug\下,运行命令名,类似于ab c.exe abc def即可。