0

クライアント アプリケーションで wcf サービス参照を構成しています。データを取得して Web ベースのデータベースに送信する一連の機能をすべて提供します。例として:

Function errorCodesGetAll(ByVal uname As String, ByVal pword As String) As String

Function errorCodesGetAllAsync(ByVal uname As String, ByVal pword As String) As System.Threading.Tasks.Task(Of String)

次のコードを使用して、リッチ テキスト ボックスに最初の関数を入力できることを知っています。

 RichTextBox1.Text = getCountryList

 Private Function getCountryList() As String
    Dim svc As New ServiceReference2.ERSAPIServiceClient
    svc.Open
    Dim str As String = svc.errorCodesGetAll(username, password)
    svc.Close()
    Return str
End Function     

WCF は私にとってまだ非常に新しい領域であるため、同じリッチ テキスト ボックスにどのようにデータを入力するのか疑問に思っていますが、今回は errorCodesGetAll 関数の非同期バリアントを使用していますか?

非同期バリアントの最適な使用方法に関するアドバイスや一般的な指針をありがとう。

4

2 に答える 2