C#中Main函式後引數的處理

iamzxf發表於2015-03-09


using System;

namespace CSharp.chapter01
{
	class commandLine
	{
		static void Main(string []args)
		{
			Console.WriteLine("引數個數={0}",args.Length);
		
			for (int i=0;i<args.Length;i++)
				Console.WriteLine("Arg[{0}]=[{1}]",i,args[i]);

			foreach(string s in args)
				Console.WriteLine(s);
		}
	}
}



相關文章