프로그래밍/C#

C# 명령줄 인수

코딩줌마 2019. 3. 24. 08:50

class CommandLine

{

static void Main(string[] args)

{

// The Length property provides the number of array elements

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]);

}

}

}

class CommandLine2

{

static void Main(string[] args)

{

System.Console.WriteLine("Number of command line parameters = {0}", args.Length);



foreach (string s in args)

{

System.Console.WriteLine(s);

}

}

}

반응형