Пример #1
0
 static void Main(string[] args)
 {
     while (true)
     {
         Console.Write(">>>");
         string code = Console.ReadLine();
         if (code.ToLower() == "quit")
         {
             break;
         }
         IConsoleServer proxy = ServUtils.CreateClient <IConsoleServer, WSDualHttpBinding, Pyconsole>("http://localhost/pycad/servers/console");
         string         res   = proxy.Exec(code);
         if (!string.IsNullOrEmpty(res))
         {
             res += "\r\n";
         }
         Console.Write(res);
     }
 }
Пример #2
0
        public void Read()
        {
            string result   = "\n";
            string previous = null;
            string current  = null;

            for (int count = 0; count < 2 || previous != "" && current != ""; count++)
            {
                previous = current;
                current  = Console.ReadLine();
                result  += "\n" + current;
            }
            result.TrimEnd(' ', '\n');
            IConsoleServer proxy = ServUtils.CreateClient <IConsoleServer, WSDualHttpBinding, Pyconsole>("http://localhost/pycad/servers/console");
            string         res   = proxy.Exec(result);

            if (!string.IsNullOrEmpty(res))
            {
                res += "\r\n";
            }
            Console.Write(res);
        }