zoukankan      html  css  js  c++  java
  • WebService 调用小例程

    Author:quietwalk   Date:2010-09-14

    using System;
    using System.Linq;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Text;
    using System.Windows.Forms;

    using GPRSTest.CommonFunctionService;//http://固定IP:14813/Service1.asmx

    namespace GPRSTest
    {
        public partial class frmWebServiceTest : Form
        { 
            public frmWebServiceTest()
            {
                InitializeComponent();
            }


            private void btnResult_Click(object sender, EventArgs e)
            {

                int a = Convert.ToInt16(this.tbA.Text.Trim());
                int b = Convert.ToInt16(this.tbB.Text.Trim());

                DateTime dtStart = DateTime.Now;

                CommonFunctionService.Service cs = new Service();
                int iResult = cs.intAdd(a, b);

                this.lbHelloWorld.Text = cs.HelloWorld();

                DateTime dtEnd = DateTime.Now;

                this.lbInfo.Text ="所用时间:  "+QuietwalkClassLibrary.CommonFunctions.GetTimeSpan(dtStart, dtEnd).ToString()+"秒";


                this.tbResult.Text = iResult.ToString();
            }

            private void btnResult_Click_1(object sender, EventArgs e)
            {
                this.lbInfo.Text = "正在调用 Webservice。。。 ";

                btnResult_Click(sender, e);

            }

            private void frmWebServiceTest_Load(object sender, EventArgs e)
            {

                this.btnResult.Focus();
            }

          
           
        }
    }

  • 相关阅读:
    HDU1026 Ignatius and the Princess I
    luogu_1865 A % B Problem
    luogu_1092 虫食算
    luogu_1111 修复公路
    luogu_1265 公路修建
    luogu_2330 [SCOI2005]繁忙的都市
    luogu_1613 跑路
    luogu_3386 【模板】二分图匹配
    luogu_3388 【模板】割点(割顶)
    luogu_2327 扫雷
  • 原文地址:https://www.cnblogs.com/quietwalk/p/1825726.html
Copyright © 2011-2022 走看看