异步调用web service并返回结果

    Private Sub btnUpdate_Click(sender As System.Object, e As System.EventArgs) Handles btnUpdate.Click
        If Trim(txtInput.Text) <> "" Then
            Dim svc As New fysem
            AddHandler svc.CallInUpdateCompleted, New FYSEMSVC.CallInUpdateCompletedEventHandler(AddressOf retV)
            svc.CallInUpdateAsync("myid", "pswd", Split(txtInput.Text, vbCrLf))

            For i As Integer = 0 To 2 Step 0
                If InStr(txtLog.Text, "END") > 0 Then Exit For
                Threading.Thread.Sleep(2000)
                txtLog.AppendText(svc.CallInUpdateStatus("myid", "pswd") & vbCrLf)
                My.Application.DoEvents()
            Next
        End If
    End Sub

    Sub retV(sender As Object, e As CallInUpdateCompletedEventArgs)
        txtLog.AppendText(e.Result & vbCrLf)
    End Sub

阅读更多
版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/Runnerchin/article/details/36012627
文章标签: web service 异步
个人分类: 代码
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

关闭
关闭
关闭