Console.Read() awaits input from the user and, upon receipt, returns an integer value corresponding with the character code of the entered character. If the input stream is ended in some way before input can be obtained, -1 is returned instead.
Console.ReadKey() awaits input from the user and, upon receipt, returns an object of class
ConsoleKeyInfo, which holds information relevant to the character which the user provided as input. For detail regarding the information provided, visit the MSDN documentation.
Console.ReadLine() will read the console input from the user, up until the next newline is detected (usually upon pressing the Enter or Return key). Code execution is paused in the current thread until a newline is provided. Afterwards, the next line of code will be executed.
Console.Write() method is identical to the
Console.WriteLine() method except that it prints the given argument(s) without a newline attached at the end. This method can be made functionally identical to
WriteLine by adding a newline string to the end of any arguments provided:
Console.WriteLine() method will print the given argument(s) with a newline attached at the end. This will print any object supplied, including, but not limited to, strings, integers, variables, floating-point numbers.
When writing objects that are not explicitly called out by the various
WriteLine overloads (that is, you are using the overload that expects a value of type
Object, WriteLine will use the
.ToString() method to generate a
String to actually write. Your custom objects should OverRide the
.ToString method and produce something more meaningful than the default implementation (which typically just writes the fully qualified type name).
Prototype of command line prompt
This prototype generate a basic command line interpreter.
It automatically get the application name and version to communicate to the user. For each input line, it recognize the command and an arbitrary list of arguments, all separated by space.
As a basic example, this code understand ver, quit and exit commands.
The parameter Project.BaseClass is a class of your project where the Assembly details are set.