Q: VB.Net Thread Pool Maximum threads allowed first question here, and its about vb.net threads. I have recently acquired a source code of a program, and I wish to make my own changes and touches to the form, but cannot seem to be able to change the maximum threads allowed. the maximum threads allowed for this program is two threads, where it goes to Netflix and logs in, bringing back the information of the account. It has a maximum of two threads, but it is also proxyless.
I included a part of code where the threadpool is, and I would love to know where to edit it whereas I can change the maximum amount of threads. I have tried looking for certain keywords, but have not found anything that would help.
 Private Sub ButtonX1_Click(sender As Object, e As EventArgs) Handles ButtonX1.Click
    If (Me.usernames.Count > 0) Then
        If (Me.ButtonX1.Text = "Start") Then
            Me.NumericUpDown1.Enabled = False
            Me.ProgressBarX1.Maximum = Me.usernames.Count
            Me.ProgressBarX1.Value = 0
            Me.thread_status = True
            Me.available = 0
            Dim workerThreads As Integer = Me.NumericUpDown1.Value
            ThreadPool.SetMinThreads(workerThreads, workerThreads)
            ThreadPool.SetMaxThreads(workerThreads, workerThreads)
            ServicePointManager.DefaultConnectionLimit = workerThreads
            ServicePointManager.Expect100Continue = False
            Dim str As String
            For Each str In Me.usernames
                ThreadPool.QueueUserWorkItem(New WaitCallback(AddressOf Me.Lam__R141), str)
            Next
            Me.ButtonX1.Text = "Stop"
            Me.Label3.Text = "Cracking Start"
        Else
            Me.NumericUpDown1.Enabled = True
            Me.thread_status = False
            Me.ButtonX1.Text = "Start"
            Me.Label3.Text = "Cracking Stop"
        End If
    Else
        Me.Label3.Text = "Load Combolist"
    End If
End Sub


A: Looking at it, I would suggest you change the bracket values from ThreadPool.SetMaxThreads(workerThreads, workerThreads), and you might also need to set ServicePointManager.DefaultConnectionLimit = workerThreads to equal something bigger.
