Home > Net > You can run the following code, but it is not the asynchronous operation. Why?
You can run the following code, but it is not the asynchronous operation. Why?
Time:09-15
Private Sub BtnTcpTestYaxin_Click (sender As Object, e As RoutedEventArgs) Handles btnTcpTestYaxin. Click Me. BtnTcpTestYaxin. Dispatcher. The BeginInvoke (New Action (Sub () 'thread.sleep (TimeSpan. FromSeconds (3)) The Debug. Print (" DDDDDDDDDDDDDDDDDDDDDDDDDDDDD ") Dim uri200 the As System. Uri=New Uri (MySettings. Default. UrlYaxin200) Dim uri250 the As System. Uri=New Uri (MySettings. Default. UrlYaxin250) The Debug. Print (uri250. Host & amp; "... "& amp; Uri250. Port) Dim ok250 As String=IIf (TcpBase TcpConnect (uri250. Host, uri250. Port), "250 ok" and "no" 250) Dim ok200 As String=IIf (TcpBase TcpConnect (uri200. Host, uri200. Port), "200 ok" and "no" 200) BtnTcpTestYaxin. The Content=ok250 & amp; VbCrLf & amp; Ok200 End Sub))
End Sub
CodePudding user response:
The entrusted still accounts for the main thread,
CodePudding user response:
Please make a suggestion
CodePudding user response:
WINFORM in asynchronous operation after me. Invoke call another program to modify the UI property, first write WPF asynchronous, don't quite understand