Is there any method of stopping the code running while the HttpWebResponse is still loading the progress?
For example I'm running this code and I'm sure it'll take 10 seconds to get the response:
Dim urlAddress As String = "https://google.com"
Dim request As HttpWebRequest = DirectCast(WebRequest.Create(urlAddress), HttpWebRequest)
Dim response As HttpWebResponse = DirectCast(request.GetResponse(), HttpWebResponse)
And now, while the request is getting response... as example at the second 4 I will press the stop button which will abort getting the response and it'll popup a MessageBox.
Private Sub btn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn.Click
HttpWebResponseName.Abort()
MessageBox.Show("Done!")
End Sub
Thank you!