Exemple #1
0
        static int Main(string[] args)
        {
            try
            {
                //Array for debuging and test from studio!
                args    = new string[3];
                args[0] = @"decompress";
                args[1] = @"new.gz";
                args[2] = @"2.iso";


                CheckInput.StringInputCheck(args);

                switch (args[0].ToLower())
                {
                case "compress":
                    zip = new Compressor(args[1], args[2]);
                    break;

                case "decompress":
                    zip = new Decompressor(args[1], args[2]);
                    break;
                }

                zip.Start();

                return(zip.CallBackResult());
            }

            catch (Exception ex)
            {
                Console.WriteLine("Error is occured!\n Method: {0}\n Error description {1}", ex.TargetSite, ex.Message);
                return(1);
            }
        }
Exemple #2
0
        static int Main(string[] args)
        {
            Console.CancelKeyPress += new ConsoleCancelEventHandler(CancelKeyPress);

            ShowInfo();

            try
            {
                args.ArgsValidation();

                switch (args[0].ToLower())
                {
                case "compress":
                    zipper = new Compressor(args[1], args[2]);
                    break;

                case "decompress":
                    zipper = new Decompressor(args[1], args[2]);
                    break;
                }

                zipper.Launch();
                return(zipper.CallBackResult());
            }

            catch (Exception ex)
            {
                Console.WriteLine($"Error is occured!\n Method: {ex.TargetSite}\n Error description: {ex.Message}");
                return(1);
            }
        }
Exemple #3
0
        static int Main(string[] args)
        {
            ShowInfo();
            try
            {
                Validation.StringReadValidation(args);

                switch (args[0].ToLower())
                {
                case "compress":
                    zipper = new Compressor(args[1], args[2]);
                    break;

                case "decompress":
                    zipper = new Decompressor(args[1], args[2]);
                    break;
                }

                zipper.Launch();

                return(zipper.CallBackResult());
            }

            catch (Exception ex)
            {
                Console.WriteLine("Error is occured!\n Method: {0}\n Error description {1}", ex.TargetSite, ex.Message);
                return(1);
            }
        }
Exemple #4
0
        static int Main(string[] args)
        {
            Console.CancelKeyPress += new ConsoleCancelEventHandler(CancelKeyPress);

            try
            {
                /*
                 * args = new string[3];
                 * args[0] = @"compress";
                 * args[1] = @"C:\Users\Ivan\Downloads\20191230_162353.jpg";
                 * args[2] = @"C:\Users\Ivan\Downloads\zipped";
                 */

                /*
                 * args = new string[3];
                 * args[0] = @"decompress";
                 * args[1] = @"C:\Users\Ivan\Downloads\zipped.gz";
                 * args[2] = @"C:\Users\Ivan\Downloads\unzipped.jpg";
                 */

                Validation.StringReadValidation(args);

                switch (args[0].ToLower())
                {
                case "compress":
                    zipper = new Compressor(args[1], args[2]);
                    break;

                case "decompress":
                    zipper = new Decompressor(args[1], args[2]);
                    break;
                }

                zipper.Launch();
                return(zipper.CallBackResult());
            }

            catch (Exception ex)
            {
                Console.WriteLine("Error is occured!\n Method: {0}\n Error description {1}", ex.TargetSite, ex.Message);
                return(1);
            }
        }