C#采用 System.Console.WriteLine向命令行傳遞參數,代碼如下: [csharp] 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]); } } }