Пример #1
0
        public static void TranslateScript(string[] args)
        {
            if (args.Length < 3)
            {
                return;
            }
            string fromLang = args[0];
            string toLang   = args[1];
            string script   = Utils.GetFileText(args[2]);

            string result = TranslateScript(script, fromLang, toLang);

            Console.WriteLine(result);
        }
Пример #2
0
        public static Variable EncodeDecode(string pathname, bool encode)
        {
            string text    = Utils.GetFileText(pathname);
            string newText = "";

            try
            {
                newText = encode ? EncodeText(text) : DecodeText(text);
            }
            catch (Exception exc)
            {
                Console.WriteLine(exc.Message);
                return(Variable.EmptyInstance);
            }

            Utils.WriteFileText(pathname, newText);
            return(new Variable(pathname));
        }