加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

WebService 使用

发布时间:2020-12-17 01:06:54 所属栏目:安全 来源:网络整理
导读: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,Even
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) ? ? { ? ? ? ? cn.com.webxml.www.WeatherWebService wws = new cn.com.webxml.www.WeatherWebService(); ? ? ? ? this.DropDownList1.DataSource = wws.getSupportProvince(); ? ? ? ? this.DropDownList1.DataBind(); ? ? } ? ? protected void Button1_Click(object sender,EventArgs e) ? ? { ? ? ? ? localhost.WebService ws = new localhost.WebService(); ? ? ? ? this.TextBox3.Text = ws.Add(Convert.ToInt32(this.TextBox1.Text),Convert.ToInt32(TextBox2.Text)).ToString(); ? ? ? ? this.GridView1.DataSource = ws.GetStudent(); ? ? ? ? this.GridView1.DataBind();? ? ? } ? ?? ? ? protected void DropDownList1_SelectedIndexChanged(object sender,EventArgs e) ? ? { ? ? ? ? cn.com.webxml.www.WeatherWebService wws = new cn.com.webxml.www.WeatherWebService(); ? ? ? ? BindCity(wws); ? ? } ? ? private void BindCity(cn.com.webxml.www.WeatherWebService wws) ? ? { ? ? ? ? this.DropDownList2.Items.Clear(); ? ? ? ? string[] strs = wws.getSupportCity(this.DropDownList1.SelectedValue); ? ? ? ? foreach (string str in strs) ? ? ? ? { ? ? ? ? ? ? this.DropDownList2.Items.Add(new ListItem(str.Substring(0,str.IndexOf("(")))); ? ? ? ? } ? ? } ? ? protected void Button2_Click(object sender,EventArgs e) ? ? { ? ? ? ? cn.com.webxml.www.WeatherWebService wws = new cn.com.webxml.www.WeatherWebService(); ? ? ? ? string[] strs = wws.getWeatherbyCityName(this.DropDownList2.SelectedValue); ? ? ? ? this.Label1.Text = strs[0] + "," + strs[1] + "<br/>"; ? ? ? ? this.Label1.Text += "温度:" + strs[5] + "<br/>"; ? ? ? ? this.Label1.Text+="风:"+strs[7]; ? ? } }

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读