这里的第一个问题,以及它的vb.net线程。我最近获得了一个程序的源代码,我希望对表单进行自己的更改和触摸,但似乎无法更改允许的最大线程数。此程序允许的最大线程是两个线程,它将转到Netflix并登录,从而返回帐户的信息。它最多有两个线程,但它也是无代理的。 我在线程池中包含了一部分代码,我很想知道在哪里编辑它,而我可以更改最大线程数。我曾尝试寻找某些关键字,但没有发现任何有用的内容。
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
答案 0 :(得分:0)
观察它,我建议您更改ThreadPool.SetMaxThreads(workerThreads, workerThreads)
的括号值,您可能还需要将ServicePointManager.DefaultConnectionLimit = workerThreads
设置为更大的值。