C# Main命令列引數(參數)
C# Main命令列引數(參數)
using System;
using System.Collections.Generic; using System.Linq; using System.Text; //bat CS_Console_print_args.exe 1,2,3 3 2 1 namespace CS_Console_print_args { class Program { static void Pause() { Console.Write(“Press any key to continue . . . “); Console.ReadKey(true); } static void Main(string[] args) { for (int i = 0; i < args.Length; i++) { Console.WriteLine(args[i]); } Pause(); } } } |