Interview Question in Visual Studio 2005


 

Interview Question :: Asynchronous Response in VB.NET

How would I convert this code into an asynchronous response. I know you use BeginGetResponse() but am unclear, even after reading the MSDN, as to how to specifically use it. Code examples are what I am looking for. Thank you

(I am using Visual Studio 2005)

CODE:
Try

Dim wrp As HttpWebResponse = _
DirectCast(myHttpWebRequest.GetResponse, HttpWebResponse)

Dim sr As New StreamReader(wrp.GetResponseStream)

Call surf()

Dim text As String = sr.ReadToEnd
RichTextBox2.Text = text.ToString
sr.Close()
wrp.Close()

Catch ex As Exception

ListBox4.Items.Add(ListBox3.Text + " : " + ex.Message)
ListBox3.Items.Remove(prox)

End Try
by ksk