Пример #1
0
        static void Main(string[] args)
        {
            Console.SetWindowPosition(0, 0);
            Console.CursorVisible = true;

            Console.SetWindowSize(width, height);
            Console.SetBufferSize(width, height);

            Console.SetCursorPosition(0, height - 2);
            Console.Write("Enter url: ");
            inputCurX = Console.CursorLeft;
            inputCurY = Console.CursorTop;

            while (true) {
                ClearCurrentConsoleLine();
                string userInput = Console.ReadLine();
                statusLineY += 1;
                int msgY = statusLineY;
                PrintStatus(string.Format("{0} : {1}", userInput, "In Progress.."), msgY);

                NonBlockingHttp http = new NonBlockingHttp(userInput);
                Task<string> getTask = http.Get();
                getTask.ContinueWith((t) => PrintStatus(string.Format("{0} : {1}", userInput, "Done!!"), msgY));
            }

            Console.ReadLine();
        }
Пример #2
0
        static void Main(string[] args)
        {
            Console.SetWindowPosition(0, 0);
            Console.CursorVisible = true;

            Console.SetWindowSize(width, height);
            Console.SetBufferSize(width, height);

            Console.SetCursorPosition(0, height - 2);
            Console.Write("Enter url: ");
            inputCurX = Console.CursorLeft;
            inputCurY = Console.CursorTop;

            while (true)
            {
                ClearCurrentConsoleLine();
                string userInput = Console.ReadLine();
                statusLineY += 1;
                int msgY = statusLineY;
                PrintStatus(string.Format("{0} : {1}", userInput, "In Progress.."), msgY);

                NonBlockingHttp http    = new NonBlockingHttp(userInput);
                Task <string>   getTask = http.Get();
                getTask.ContinueWith((t) => PrintStatus(string.Format("{0} : {1}", userInput, "Done!!"), msgY));
            }

            Console.ReadLine();
        }