我正在通过一个按钮从 Windows 窗体(vb.net 4.5)调用 Web 服务
我的问题,当我单击按钮时,进度条没有任何反应,并且界面似乎冻结/无响应
我相信我需要将 Web 服务调用放入一个线程来完成此操作
这是我到目前为止所得到的
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
ProgressBar1.Style = ProgressBarStyle.Marquee
ProgressBar1.MarqueeAnimationSpeed = 5
Dim webservice As New somewebservice.somewsdl
Dim output(3) As String
'this method can take 1-10 seconds...
Try
output = somewebservice.method()
Catch ex As Exception
txtErrorDesc.Text = ex.Message
End Try
ProgressBar1.MarqueeAnimationSpeed = 0
End Sub