日期:2014-05-17  浏览次数:20886 次

C#系列教程——传递给命令行应用程序

C#采用 System.Console.WriteLine向命令行传递参数,代码如下:

class CommandLine
{
    static void Main(string[] args)
    {
        System.Console.WriteLine("parameter count = {0}", args.Length);
        for (int i = 0; i < args.Length; i++)
        {
            System.Console.WriteLine("Arg[{0}] = [{1}]", i, args[i]);
        }
    }
}