public async Task Run(string sendAddress, string sendToken)
        {
            using (var streamClient = new StreamClient(sendAddress, sendToken, isDynamicEndpoint : false))
            {
                var stdout = Console.Out;
                Console.WriteLine("Don't look here!");
                Console.SetOut(new StreamWriter(streamClient) { AutoFlush = true });
                Console.WriteLine("Look over here!");
                Console.WriteLine("The output is printed on the server!");
                for (int i = 0; i < 100; i++)
                {
                    Console.WriteLine(i);
                }
                Console.SetOut(stdout);

                Console.ReadLine();
            }
        }
예제 #2
0
        public async Task Run(string sendAddress, string sendToken)
        {
            using (var streamClient = new StreamClient(sendAddress, sendToken, isDynamicEndpoint: false))
            {
                var stdout = Console.Out;
                Console.WriteLine("Don't look here!");
                Console.SetOut(new StreamWriter(streamClient)
                {
                    AutoFlush = true
                });
                Console.WriteLine("Look over here!");
                Console.WriteLine("The output is printed on the server!");
                for (int i = 0; i < 100; i++)
                {
                    Console.WriteLine(i);
                }
                Console.SetOut(stdout);

                Console.ReadLine();
            }
        }