制作可以从外面传递参数的exe程序比较简单的例子

以前还以为很神奇呢 今天试了一下发现比较简单吧

下面展示一下

代码文件

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TestExePara
{
    class Program
    {
        static void Main(string[] args)
        {
            string strSum = string.Empty;
            foreach (string str in args)
            {
                strSum = strSum + str+"|";
            }
            Console.WriteLine(strSum);
        }
    }
}

生成的文件放在E盘debug目录下

执行的效果

原文地址:https://www.cnblogs.com/huang361964533/p/3108724.html