Пример #1
0
        } // end Main() function

        // Driver function
        private static int driver()
        {
            Console.WriteLine("Hello, World.\n");

            // Stores dumpStringArray from useful class into a string list.
            List <string> inpstrings;

            readStringsFromKeyboard(out inpstrings);
            Useful.dumpStringList(inpstrings, "keyboard input:");

            Console.Write("Press Enter to continue...");
            Console.ReadLine();

            return(SUCCESS);
        } // end function driver()
Пример #2
0
        public static int Main(string[] args)
        {
            Useful.dumpStringArray(args, "command line arguments:");

            // Driver function returns results to the result variable as an int.
            int result = driver();

            // return the terminal status of the program back to the user.
            // normally for command line interface programs,
            // a return code of 0 means "SUCCESS"
            // anything else means "FAIL"
            Console.WriteLine("\ndisplay result by typing ");
            Console.WriteLine("    \"echo %ERRORLEVEL%\" in Windows, or ");
            Console.WriteLine("    \"echo $?\" in Linux \n");
            return(result);
        } // end Main() function