// arguments: John Paul Mary
using System;
public class CommandLine2
{
public static void Main(string[] args)
{
Console.WriteLine("Number of command line parameters = {0}",
args.Length);
foreach(string s in args)
{
Console.WriteLine(s);
}
}
}
Output
Run the program using some arguments like this: cmdline2 John Paul Mary.
The output will be:
Number of command line parameters = 3
John
Paul
Mary
Example foreach in C#
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment