I am using a stream to connect to a website and retrieve the source. I would like to be able to automaticly stop hte process if the website does not work. so I implemented a timer and set the interval to 10 seconds. now I would like to stop the stream from attemting to connect the the website. would this be possible?
Timer2.Enabled = True
Timer1.Interval = 10000
stream = New IO.StreamReader(wc.OpenRead(ChooseURL(m)))
Timer2.Enabled = False
Private Sub Timer2_Tick(ByVal Sender As Object, ByVal e As EventArgs) Handles Timer1.Tick
Timer2.Enabled = False
End Sub
Now keep in mind that this is the second time I ever used a timer so I am not too familiar with how it works. If I am doing something wrong please correct me. Thank you.
Timer2.Enabled = True
Timer1.Interval = 10000
stream = New IO.StreamReader(wc.OpenRead(ChooseURL(m)))
Timer2.Enabled = False
Private Sub Timer2_Tick(ByVal Sender As Object, ByVal e As EventArgs) Handles Timer1.Tick
Timer2.Enabled = False
End Sub
Now keep in mind that this is the second time I ever used a timer so I am not too familiar with how it works. If I am doing something wrong please correct me. Thank you.