classWhileapp {//This is a server model that supports single-user Public Static voidMain () {//Welcome information for printing SoftwareConsole.WriteLine ("Welcome to use Whileapp V0.1"); //Print command input characterConsole.Write (">"); //command to store the user's commands stringcommand; //commands to read into the user//command exits the program for exit while(Command = Console.ReadLine ())! ="Exit") { Switch(command) {//handling the Get command Case "Get": Doget (); Break; //working with put commands Case "put": DoPut (); Break; //Handling Default Commands default: Dodefault (); Break; } //Print command input characterConsole.Write (">"); } } //handling the Get command Private Static intdoget () {//to add a real get processing actionConsole.WriteLine ("get file ... ok"); return 0; } //working with put commands Private Static intDoPut () {//to add a real put processing actionConsole.WriteLine ("transfer files ... ok"); return 0; } //Handling Default Commands Private Static intDodefault () {//Print error messageConsole.WriteLine ("Command Error"); //prompt for correct usageConsole.WriteLine ("the set of commands supported by Whileapp V0.1 are:"); Console.WriteLine ("\tget:\t getting files"); Console.WriteLine ("\tget:\t Transferring Files"); Console.WriteLine ("\texit:\t Exit Program"); return 0; }}
Run results
_09_while Cycle __