Hi,

I created a class that reads the contents of a webpage based on the response from the server, here's the vb.net code:

Code:
Dim wrq As HttpWebRequest
Dim wres As HttpWebResponse
Dim sr As StreamReader

Dim s As Stream

wrq = CType(WebRequest.Create(url), HttpWebRequest)
            
Try
    wres = CType(wrq.GetResponse(), HttpWebResponse)
    sr = New StreamReader(wres.GetResponseStream())
    strResponse = sr.ReadToEnd()           
Finally
    sr.Close()
    wres.Close()
End Try
The problem is when the url is invalid then the streams aren't closed properly.