If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Re: Book for command-line application

There's not much special for command line applications. Arguments passed on the command line (seperated by spaces) get put into the args argument of main(string[] args). You can figure out how many arguments by calling args.Length. Loop over them like:

Code:

for(int i = 0; i < args.Length; i++)
{
Console.WriteLine(args[i]); //Print the args to output... or whatever you want to do with them
}

You can read from the console like:

Code:

string someData = Console.ReadLine(); //User enters information until they push enter, in which case the string gets stored in the newly-declared someData variable.

You can write to the console like:

Code:

Console.Write("Blah"); //Write blah to the console, without a new line
Console.WriteLine("Blah"); //Write blah to the console, then add a new line
Console.WriteLine("{0} is {1}", "programming", "fun"); //Write "programming is fun" to the console, then add a new line

File IO can be done (for many files) most efficiently like (make sure you have the System.IO using directive):

* The Perfect Platform for Game Developers: Android
Developing rich, high performance Android games from the ground up is a daunting task. Intel has provided Android developers with a number of tools that can be leveraged by Android game developers.

* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.