争怎路由网:是一个主要分享无线路由器安装设置经验的网站,汇总WiFi常见问题的解决方法。

webservice系列教学(8)-如何调用webservice(vb.net)

时间:2024/7/10作者:未知来源:争怎路由网人气:

4.7使用vb.net调用
无需下载任何组件
新建项目Visual Basic项目windows应用程序。
在解决方案资源管理器中添加web引用,输入wsdl文件所在地址。
将web引用改名为yundan.
yundan.(service_name)即可引用
*需引用System.web.services*
例程:
Public Class Form1
Inherits System.Windows.Forms.Form
#Region " Windows 窗体设计器生成的代码 "
Public Sub New()
MyBase.New()
InitializeComponent()
End Sub
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
Private components As System.ComponentModel.IContainer
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents TextBox1 As System.Windows.Forms.TextBox
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.Label1 = New System.Windows.Forms.Label()
Me.TextBox1 = New System.Windows.Forms.TextBox()
Me.SuspendLayout()
Me.Label1.AutoSize = True
Me.Label1.Location = New System.Drawing.Point(96, 40)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(91, 14)
Me.Label1.TabIndex = 0
Me.Label1.Text = "Webservice演示"
Me.TextBox1.Location = New System.Drawing.Point(88, 144)
Me.TextBox1.Name = "TextBox1"
Me.TextBox1.TabIndex = 1
Me.TextBox1.Text = "TextBox1"
Me.AutoScaleBaseSize = New System.Drawing.Size(6, 14)
Me.ClientSize = New System.Drawing.Size(292, 273)
Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.TextBox1, Me.Label1})
Me.Name = "Form1"
Me.Text = "VB.net webserive演示"
Me.ResumeLayout(False)
End Sub
#End Region
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim cc As yundan.Service1 = New yundan.Service1()
TextBox1.Text = cc.test(12, 123)
End Sub
End Class


关键词:webservice系列教学(8)-如何调用webservice(vb.net)




Copyright © 2012-2018 争怎路由网(http://www.zhengzen.com) .All Rights Reserved 网站地图 友情链接

免责声明:本站资源均来自互联网收集 如有侵犯到您利益的地方请及时联系管理删除,敬请见谅!

QQ:1006262270   邮箱:kfyvi376850063@126.com   手机版