Ejemplo n.º 1
0
        public static void Main(string[] args)
        {
            /*
             * args = new string[] { "0", @"G:\DComics\ComicsIDownload\bin\Debug\netcoreapp3.0\json.txt", @"G:\141606" };
             * args = new string[] { "1", @"json.txt", @"G:\141606" };
             */
            try
            {
                FileService fileService = new FileService();
                logger = InitLogger();
                logger.Info("Inicio del proceso");

                int    option          = !string.IsNullOrEmpty(args[0]) ? int.Parse(args[0]) : 0;
                string infoAdditional  = !string.IsNullOrEmpty(args[1]) ? args[1] : string.Empty;
                string infoAdditional2 = !string.IsNullOrEmpty(args[2]) ? args[2] : string.Empty;

                if (!fileService.CheckDirectories())
                {
                    logger.Info("Fin del proceso por falta de carpetas");
                    return;
                }

                ExecuteService(option, infoAdditional, infoAdditional2);

                logger.Info("Fin del proceso");
            }
            catch (Exception ex)
            {
                if (logger != null)
                {
                    logger.Error(string.Format("Error en el método: '{0}', Mensaje de error: '{1}'", MethodBase.GetCurrentMethod().Name, ex.Message));
                }
            }
        }