Example #1
0
        static void Main(string[] args)
        {
            BasicHttpBinding             bind       = new BasicHttpBinding();
            ChannelFactory <IMatematika> objChannel = new
                                                      ChannelFactory <IMatematika>(bind, "http://localhost:1907");
            IMatematika obj         = objChannel.CreateChannel();
            double      hasilTambah = obj.Tambah(1, 2);

            Console.WriteLine("1 + 2 = " + hasilTambah);
            double hasilKurang = obj.Kurang(3, 2);

            Console.WriteLine("3 - 2 = " + hasilKurang);
            double hasilKali = obj.Kali(2, 2);

            Console.WriteLine("2 x 2 = " + hasilKali);
            double hasilBagi = obj.Bagi(2, 2);

            Console.WriteLine("2 / 2 = " + hasilBagi);
            Console.ReadLine();
            Koordinat objk = new Koordinat();
        }
Example #2
0
        private void Form1_Load(object sender, EventArgs e)
        {
            BasicHttpBinding             bind       = new BasicHttpBinding();
            ChannelFactory <IMatematika> objChannel = new ChannelFactory <IMatematika>(bind, "http://localhost:1907");
            IMatematika obj         = objChannel.CreateChannel();
            double      hasilTambah = obj.Tambah(1, 2);
            // Console.WriteLine("1 + 2 = " + hasilTambah);
            double hasilKurang = obj.Kurang(3, 2);
            // Console.WriteLine("3 - 2 = " + hasilKurang);
            double hasilKali = obj.Kali(2, 2);
            // Console.WriteLine("2 x 2 = " + hasilKali);
            double hasilBagi = obj.Bagi(2, 2);
            // Console.WriteLine("2 / 2 = " + hasilBagi);
            // Console.ReadLine();
            Koordinat objk = new Koordinat();

            textBox1.Text = "1 + 2 = " + hasilTambah + Environment.NewLine;
            textBox2.Text = "3 - 2 = " + hasilKurang + Environment.NewLine;
            textBox3.Text = "2 x 2 = " + hasilKali + Environment.NewLine;
            textBox4.Text = "2 / 2 = " + hasilBagi + Environment.NewLine;
        }
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Form1());
            BasicHttpBinding             bind       = new BasicHttpBinding();
            ChannelFactory <IMatematika> objChannel = new ChannelFactory <IMatematika>(bind, "http://localhost:1907");
            IMatematika obj         = objChannel.CreateChannel();
            double      hasilTambah = obj.Tambah(1, 2);

            Console.WriteLine("1 + 2 = " + hasilTambah);
            double hasilKurang = obj.Kurang(3, 2);

            Console.WriteLine("3 - 2 = " + hasilKurang);
            double hasilKali = obj.Kali(2, 2);

            Console.WriteLine("2 x 2 = " + hasilKali);
            double hasilBagi = obj.Bagi(2, 2);

            Console.WriteLine("2 / 2 = " + hasilBagi);
            Console.ReadLine();

            Koordinat objk = new Koordinat();
        }