先加入服務參考,再後置程式碼輸入以下內容即可。
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
int a = int.Parse(TextBox1.Text);
int b = int.Parse(TextBox2.Text);
ServiceReference1.WebServiceSoapClient ws = new ServiceReference1.WebServiceSoapClient();
string result = ws.count(a ,b).ToString();
Response.Write(result);
}
}
全站熱搜
留言列表