Sample for Console Application with Command line arguments
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Args count:" + args.Length.ToString());
foreach (string arg in args)
Console.WriteLine("\t" + arg);
}
}
Sample outputs
MyApps>CmdLineApp.exe
Args count:0MyApps>CmdLineApp.exe Hello World
Args count:2
Hello
WorldMyApps>CmdLineApp.exe "Hello World" Command line application
Args count:4
Hello World
Command
line
applicationMyApps>CmdLineApp.exe "Hello World" "Command line application"
Args count:2
Hello World
Command line application
No comments:
Post a Comment