simpleonline
Active member
- Joined
- Sep 13, 2011
- Messages
- 33
- Programming Experience
- Beginner
Okay so I've dug around all day and found that using multiple "background workers" would do what I would need for my application.
How can I create 4 background workers and then feed the urls to the webrequest from a listbox?
I'm basically needing to have each webrequest access the listbox, grab a URL, process the webrequest and then go grab the next url on file.
I am trying to have that running 4x at a time until the sites are all looped through.
I've read a background worker is good vs. multi threading because it's easier to code.
How can I create 4 background workers and then feed the urls to the webrequest from a listbox?
VB.NET:
Dim request As HttpWebRequest = HttpWebRequest.Create(URLGOESERE)
Dim response As HttpWebResponse
response = CType(request.GetResponse, HttpWebResponse)
Dim webstream As Stream = response.GetResponseStream
Dim streamreader As New StreamReader(webstream, Encoding.UTF8)
Dim html As String = streamreader.ReadToEnd
Messagebox.show(html.tostring)
I'm basically needing to have each webrequest access the listbox, grab a URL, process the webrequest and then go grab the next url on file.
I am trying to have that running 4x at a time until the sites are all looped through.
I've read a background worker is good vs. multi threading because it's easier to code.