コード例 #1
0
ファイル: Program.cs プロジェクト: mlevin23/MusicStats
        static void Main(string[] args)
        {
            if (args.Length != 2)
            {
                Console.WriteLine("CrimeAnalyzer <crime_csv_file_path> <report_file_path>");
                Environment.Exit(1);
            }

            string DataFilePath   = args[0];
            string reportFilePath = args[1];

            List <MusicStats> musicStatsList = null;

            try
            {
                musicStatsList = MusicLoader.Load(DataFilePath);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                Environment.Exit(2);
            }

            var report = MusicStatsReport.GenerateText(musicStatsList);

            try
            {
                System.IO.File.WriteAllText(reportFilePath, report);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                Environment.Exit(3);
            }
        }
コード例 #2
0
        static void Main(string[] args)
        {
            if (args.Length != 2)
            {
                Console.WriteLine("MusicPlaylistAnalyzer <music_playlist_file_path> <report_file_path>");
                Environment.Exit(1);
            }

            string musicFile  = args[0];
            string reportFile = args[1];

            List <MusicCategories> musicCategoriesList = null;

            try
            {
                musicCategoriesList = MusicLoader.Load(musicFile);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                Environment.Exit(2);
            }

            var makeReport = MusicReport.GenerateText(musicCategoriesList);

            try
            {
                System.IO.File.WriteAllText(reportFile, makeReport);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                Environment.Exit(3);
            }
        }
コード例 #3
0
        static void Main(string[] args)
        {
            if (args.Length != 2)
            {
                Console.WriteLine("MusicPlaylistAnalyzer <music_playlist_file_path> <report_file_path>");
                Environment.Exit(1);
            }

            string txtDataFilePath   = args[0];
            string questionsFilePath = args[1];

            List <MusicPlaylist> MusicPlay = null;

            try
            {
                MusicPlay = MusicLoader.Load(txtDataFilePath);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                Environment.Exit(2);
            }

            var questions = Questions.GenerateText(MusicPlay);

            Console.WriteLine(questions);

            try
            {
                System.IO.File.WriteAllText(questionsFilePath, questions);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                Environment.Exit(3);
            }
        }