I finally use asynchronous calls WS, happy.

xiaoxiao2021-03-06  86

WS End _ Public Function HelloWorld (Byval Temp As String) AS STRING RETURN TEMP END FUNCTION

Client definition new class public class class1 private m_wsdata as new localhost.service1

Public Function beginhellow () As IAsyncResult Try Return m_WsData.BeginHelloWorld ( "Good afternoon", Nothing, New Object) Catch ex As Exception MessageBox.Show ( "beginhellow error!" & Ex.Message & vbNewLine & ex.StackTrace) Return Nothing END TRY END FUNCTION

Public Function Endhellow (ByVal ar As IAsyncResult) As String Dim temp As String Try Return m_WsData.EndHelloWorld (ar) Catch ex As Exception Return "Endhellow error!" & Ex.Message & ex.StackTrace End Try End FunctionEnd Class

Client Using DIM TEMP AS New Class1 Dim Ar As IasyncResult Ar = Temp.BeginHellow () 'ar.asyncwaithandle.waitone ()

IF (ar.iscompleted) THEN DIM Result As String Result = Temp.Endhellow (ar) textbox1.text = result endiff

转载请注明原文地址:https://www.9cbs.com/read-101190.html

New Post(0)