I'm trying to implement a simple code but I want it to be threaded as many times as a combobox says.
For example:
Combo box value is: 25
This means the thread count is '25'.
I want a certain piece of code to run 25 times off a listbox but not duplicate each item 25 times like it seems to do when I 'multi-thread' it.
My idea for a code:
But how do I get this above code to run the combo box value into threads?
My code I'm trying to get multithreaded by the combobox value:
(this is just a sample code and will not be used in my project).
I can't seem to figure out in my head how to make the two work off each other... Ninja tried helping me, but I don't want to mooch off his quality skill.
Thanks for the help!
For example:
Combo box value is: 25
This means the thread count is '25'.
I want a certain piece of code to run 25 times off a listbox but not duplicate each item 25 times like it seems to do when I 'multi-thread' it.
My idea for a code:
Code
for i as integer = 1 to combobox1.value
listbox2.items.add(i)
next
end sub
end classBut how do I get this above code to run the combo box value into threads?
My code I'm trying to get multithreaded by the combobox value:
Code
Private Sub Checker()
Dim myproxy As WebProxy
Dim proxies As New List(Of String)
For Each proxy As String In ListBox1.Items
Try
myproxy = New WebProxy(proxy)
Dim r As HttpWebRequest = WebRequest.Create("http://www.google.com")
r.UserAgent = "Mozilla/5.0 (windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.2 Safari/537.36"
r.Timeout = 3000
r.Proxy = myproxy
Dim re As HttpWebResponse = r.GetResponse()
ListBox2.Items.Add(proxy)
Catch ex As Exception
ListBox3.Items.Add("FAILED " & proxy)
End Try
Next
End Sub(this is just a sample code and will not be used in my project).
I can't seem to figure out in my head how to make the two work off each other... Ninja tried helping me, but I don't want to mooch off his quality skill.
Thanks for the help!



