添加Web 引用
http://localhost/myweb/service.asmx
默认是localhost;
private void button1_Click(object sender, EventArgs e)
{
localhost.SecurityWebService ser = new localhost.SecurityWebService();
localhost. SecurityInfo info=ser.GetSecurityInfo(textBox1.Text);
textBox2.Text = info.CompanyName;
textBox3.Text = info.Price.ToString();
}
本文介绍了一个使用C#添加Web服务引用的例子。通过按钮点击事件调用远程Web服务,获取安全信息,并显示公司名称及价格。示例代码展示了如何创建服务引用、调用方法并处理返回的数据。
179

被折叠的 条评论
为什么被折叠?



