WEB开发网
开发学院手机开发Windows Mobile 开发 Windows Mobile WebService 调用小例程 阅读

Windows Mobile WebService 调用小例程

 2010-09-15 23:59:00 来源:WEB开发网   
核心提示:Author:quietwalk Date:using System;using System.Linq;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using S

Author:quietwalk Date:

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();

}

}

}

Tags:Windows Mobile WebService

编辑录入:coldstar [复制链接] [打 印]
赞助商链接