Hi,
I have a function called SendRequest that takes a URL and handles the sending of the webrequest, and the receipt of the webresponse. Code follows:
The problem is that I have to manually extract the components from the returned string "retstr". Is there a way to convert this string into a HTML document?
Any help would be appreciated.
Thanks,
N
I have a function called SendRequest that takes a URL and handles the sending of the webrequest, and the receipt of the webresponse. Code follows:
Code:
Private Function SendRequest(ByVal http_url as string) as string
Dim l_response as Net.WebResponse, l_webrequest as Net.WebRequest, l_datastream as System.IO.Stream, retstr as string
Try
l_webrequest = Net.WebRequest.Create(http_url)
l_response = l_webrequest.GetResponse
l_datastream = l_response.GetResponseStream
Dim l_datareader as New System.IO.StreamReader(l_datastream)
retstr = l_datareader.ReadToEnd
l_response.close
Catch Ex as Net.WebException
' Some error handling
End Try
End Function
Any help would be appreciated.
Thanks,
N