Esempio n. 1
0
        static void Main(string[] args)
        {
            SourceScriptParser SourceScriptParser = new SourceScriptParser();

redo:
            {
                Console.WriteLine("section");
                string s = Console.ReadLine();
                Console.WriteLine("");
                Console.WriteLine("setting");
                string s1 = Console.ReadLine();
                Console.WriteLine("");
                Console.WriteLine("key");
                string k = Console.ReadLine();
                Console.WriteLine("");
                SourceScriptParser.AddSetting(s, s1, k);
            }
            Console.WriteLine("");
            Console.WriteLine("continue? yes or no");
            if (Console.ReadLine().ToString().ToLower() == "yes")
            {
                goto redo;
            }
            else
            {
                Console.WriteLine("filename");
                SourceScriptParser.SaveSetting(Console.ReadLine().ToString());
            }
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            ConsoleColor       ori1 = Console.ForegroundColor;
            ConsoleColor       ori2 = Console.BackgroundColor;
            SourceScriptParser SourceScriptParser = new SourceScriptParser();

            Console.WriteLine("Plz drag source engine script to here and enter");
            try
            {
                string file = Console.ReadLine();
                if (file.StartsWith("\"") && file.EndsWith("\""))
                {
                    file = file.Substring(1, file.Length - 2);
                }
                SourceScriptParser.Parser(file);
            }
            catch (Exception a)
            {
                Console.ForegroundColor = ConsoleColor.Red;
                Console.BackgroundColor = ConsoleColor.Black;
                Console.Write("Error");
                Console.ForegroundColor = ori1;
                Console.BackgroundColor = ori2;
                Console.Write(":" + a);
                Console.ReadLine();
                return;
            }
redo:
            {
                Console.WriteLine("");
                Console.WriteLine("input a Section Name and press any key to next");
                Console.WriteLine("");
                string s = Console.ReadLine();
                Console.WriteLine("");
                Console.WriteLine("input a Setting Name and press any key to get Key");
                Console.WriteLine("");
                string s1 = Console.ReadLine();
                Console.WriteLine("");
                Console.WriteLine("The Key of " + s1 + " is " + SourceScriptParser.GetSetting(s, s1));
                Console.ReadLine();
            }
            Console.WriteLine("continue? yes or no");
            if (Console.ReadLine().ToString().ToLower() == "yes")
            {
                goto redo;
            }
        }