Do While loopctr < 1000
Try
Dim req1 As HttpWebRequest = HttpWebRequest.Create(site)
Catch e2 As UriFormatException
lblbox.Text = e2.Message.ToString
Exit Sub
End Try
Dim tickStart1 As Integer = Environment.TickCount
Dim req As HttpWebRequest = HttpWebRequest.Create(site)
Dim s As Stream
Dim resp As WebResponse
req.Accept = "image/gif, image/jpeg, image/pjpeg, text/plain, text/html, */*"
req.ContentType = "image/gif, image/jpeg, image/pjpeg, text/plain, text/html, */*"
Try
req.Timeout = 10000
resp = req.GetResponse()
Catch e As WebException
TextBox4.Text = e.Message
errcounter = errcounter + 1
TextBox1.Text = errcounter
GoTo exitloop
End Try
TextBox3.Text = resp.ResponseUri.ToString
TextBox3.Text = TextBox3.Text & "::" & resp.IsFromCache
Try
s = resp.GetResponseStream()
Catch e As Exception
TextBox4.Text = e.ToString
errcounter = errcounter + 1
TextBox1.Text = errcounter
End Try
Dim sr As StreamReader = New StreamReader(s, Encoding.ASCII)
Dim doc As String
Try
doc = sr.ReadToEnd()
Catch e As WebException
TextBox4.Text = e.ToString
errcounter = errcounter + 1
TextBox1.Text = errcounter
End Try
Dim contentlength As Integer = doc.Length
|