正文

用vb.net调用webservices2008-08-30 23:06:00

【评论】 【打印】 【字体: 】 本文链接:http://blog.pfan.cn/yzrj/37982.html

分享到:

 无需下载任何组件Visualà项目à新建 windows应用程序。àBasic项目在解决方案资源管理器中添加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 SubEnd Class

阅读(3106) | 评论(0)


版权声明:编程爱好者网站为此博客服务提供商,如本文牵涉到版权问题,编程爱好者网站不承担相关责任,如有版权问题请直接与本文作者联系解决。谢谢!

评论

暂无评论
您需要登录后才能评论,请 登录 或者 注册