I make a request, stuff it into a stringbuffer, then append it to a
textbox. It works on many sites (e.g. yahoo.com), but not on many
others (e.g. amazon.com). Any insight that could be provided would be
greatly appreciated.
Relevant code:
Sub GetPage()
Try
Dim loRequest As HttpWebRequest
Dim loResponse As HttpWebResponse
Dim loSR As StreamReader
Dim loSB As New StringBuilder
loRequest = CType(WebRequest.Create("http://www.amazon.com"),
HttpWebRequest)
loResponse = CType(loRequest.GetResponse(), HttpWebResponse)
loSR = New StreamReader(loResponse.GetResponseStream,
Encoding.ASCII)
loSB.Append(loSR.ReadToEnd)
loSR.Close()
txtStatus.AppendText(loSB.ToString)
Catch ex As Exception
MessageBox.Show(ex.ToString)
End Try
End Sub