国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發(fā) > 綜合 > 正文

webservice系列教學(6)-如何調(diào)用webservice(C#,)

2024-07-21 02:27:40
字體:
供稿:網(wǎng)友
4. 5使用c#調(diào)用
無需下載任何組件
新建項目visual c#項目windows應用程序。
在解決方案資源管理器中添加web引用,輸入wsdl文件所在地址。
將web引用改名.
yundan.(service_name)即可引用
*需引用system.web.services*
例程:
using system;
using system.drawing;
using system.collections;
using system.componentmodel;
using system.windows.forms;
using system.data;
namespace csharp
{
        public class form1 : system.windows.forms.form
        {
            private system.windows.forms.label label1;
            private system.windows.forms.textbox textbox1;
            private system.componentmodel.container components = null;
            public form1()
            {
                initializecomponent();
            }
            protected override void dispose( bool disposing )
            {
                if( disposing )
                {
                    if (components != null)
                    {
                        components.dispose();
                    }
                }
                base.dispose( disposing );
            }
            #region windows form designer generated code
            private void initializecomponent()
            {
                this.label1 = new system.windows.forms.label();
                this.textbox1 = new system.windows.forms.textbox();
                this.suspendlayout();
                this.label1.autosize = true;
                this.label1.location = new system.drawing.point(88, 48);
                this.label1.name = "label1";
                this.label1.size = new system.drawing.size(91, 14);
                this.label1.tabindex = 0;
                this.label1.text = "webservice演示";
                this.textbox1.location = new system.drawing.point(88, 128);
                this.textbox1.name = "textbox1";
                this.textbox1.tabindex = 1;
                this.textbox1.text = "textbox1";
                this.autoscalebasesize = new system.drawing.size(6, 14);
                this.clientsize = new system.drawing.size(292, 273);
                this.controls.addrange(new system.windows.forms.control[]
{
                this.textbox1,
                this.label1
});
                this.name = "form1";
                this.text = "c#webservie演示";
                this.load += new system.eventhandler(this.form1_load);
                this.resumelayout(false);
            }
            #endregion
            [stathread]
            static void main()
            {
                application.run(new form1());
            }

            private void form1_load(object sender, system.eventargs e)
            {
                int str;
                你的web引用的名字.service1 cc=new 你的web引用的名字.service1();
                str=cc.test(123,324);
                textbox1.text=str.tostring();
            }
        }
}

發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 无为县| 咸丰县| 玉溪市| 中阳县| 周宁县| 射阳县| 汝城县| 尼玛县| 武强县| 启东市| 当涂县| 遂平县| 莱西市| 北安市| 育儿| 葵青区| 吉首市| 林芝县| 普格县| 巨野县| 宁河县| 宝兴县| 太和县| 咸宁市| 新源县| 南康市| 龙州县| 百色市| 罗平县| 南宁市| 开远市| 四川省| 炎陵县| 库伦旗| 财经| 乐至县| 武乡县| 广昌县| 梅州市| 靖州| 馆陶县|