コード例 #1
0
 static void Main(string[] args) {
     Console.WriteLine("Ask the magic 8 Ball");
     using (EightBallClient ballClient = new EightBallClient("NetTcpBinding_IEightBall")) {
         Console.WriteLine("Your question");
         string question = Console.ReadLine();
         string answer = ballClient.ObtainAnswerToQuestion(question);
         Console.WriteLine("8-ball says: {0}", answer);
     }
     Console.ReadLine();
 }
コード例 #2
0
        static void Main()
        {
            Console.WriteLine("***** Ask the Magic 8 Ball (VS) *****");

//			using (EightBallClient ball = new EightBallClient()) {
            using (EightBallClient ball = new EightBallClient("BasicHttpBinding_IEightBall")) {
                Console.WriteLine("Your question: ");
                string question = Console.ReadLine();
                string answer   = ball.ObtainAnswerToQuestion(question);
                Console.WriteLine($"Question : {question}");
                Console.WriteLine($"Answer   : {answer}");
            }
        }
コード例 #3
0
ファイル: Program.cs プロジェクト: usedflax/flaxbox
        static void Main(string[] args)
        {
            Console.WriteLine("***** Ask the Magic 8 Ball *****\n");

            using (EightBallClient ball = new EightBallClient("BasicHttpBinding_IEightBall"))
            {
            Console.Write("Your question: ");
            string question = Console.ReadLine();
            string answer =
              ball.ObtainAnswerToQuestion(question);
            Console.WriteLine("8-Ball says: {0}", answer);
            }
            Console.ReadLine();
        }
コード例 #4
0
ファイル: Program.cs プロジェクト: tijokjoy/exercises
        static void Main(string[] args)
        {
            Console.WriteLine("***** Ask the Magic 8 Ball *****\n");

            using (EightBallClient ball = new EightBallClient("NetTcpBinding_IEightBall"))
            //using (EightBallClient ball = new EightBallClient("BasicHttpBinding_IEightBall"))
            {
                Console.Write("Your question: ");
                string question = Console.ReadLine();
                string answer   =
                    ball.ObtainAnswerToQuestion(question);
                Console.WriteLine("8-Ball says: {0}", answer);
            }
            Console.ReadLine();
        }
コード例 #5
0
ファイル: Program.cs プロジェクト: red201432/CSharpLearn
        static void Main(string[] args)
        {
            Console.WriteLine(" ****** Ask the question you want ****");
          // MagicEightBallService1 ball = new MagicEightBallService1(); //引入类型来操作
            using (EightBallClient ball = new EightBallClient())//通过引入服务生成的代码来操作
            {
            while (true)
            {
                Console.WriteLine(" Your question");

                string question = Console.ReadLine();

                string answer = ball.ObtainAnswerToQuestion(question);

                Console.WriteLine(answer);
            }
        }
        }