⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ex-16-04

📁 Programming Csharp Source Code(代码) Programming Csharp Source Code
💻
字号:
// Example 16-04: A client program to test the calculator web service

using System;

// driver program to test the web service
public class Tester
{
   public static void Main()
   {
      Tester t = new Tester();
      t.Run();
   }

   public void Run()
   {
      int var1 = 5;
      int var2 = 7;

      // instantiate the web service proxy
      WSCalc.Service1 theWebSvc = 
         new WSCalc.Service1();

      // cal the add method
      Console.WriteLine("{0} + {1} = {2}", var1, var2,
         theWebSvc.Add(var1, var2));

      // build a table by repeatedly calling the pow method
      for (int i = 2;i<10; i++)
         for (int j = 1;j <10;j++)
         {
            Console.WriteLine("{0} to the power of {1} = {2}", i, j,
               theWebSvc.pow(i, j));
         }
   }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -