示例#1
0
        static void Main(string[] args)
        {
            if (args.Length != 1)
            {
                Console.WriteLine("Provide a file name as parameter.");
                return;
            }

            var fileName = args[0];

            if (!File.Exists(fileName))
            {
                Console.WriteLine("File does not exists.");
                return;
            }

            string[] names       = File.ReadAllLines(fileName);
            var      sortedNames = Sorter.Sort(names);

            OutputToScreen(sortedNames);
            OutputToFile(sortedNames);
        }
示例#2
0
        public static void Main(string[] args)
        {
            Sorter nm = new Sorter(args[0]);

            nm.SortName();
        }