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); }
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)); }