因为要写采集什么的。发现单个非常慢。感觉多线程。应该会快一些。所以弄了个多线程实例笔记。
Dim a As System.Threading.Thread Private Delegate Sub VoidShow(ByVal str As String) '定义要委托的类型 Private Sub Button2_Click_1(sender As Object, e As EventArgs) Handles Button2.Click a = New System.Threading.Thread(AddressOf ShowNumber) '创建线程 a.Start() '开始 End Sub Private Sub ShowNumber(str) For i = 1 To 1000 Dim ivo As New VoidShow(AddressOf TureShowNumber) '定义委托 Invoke(ivo, i.ToString() + ",") '去委托 System.Threading.Thread.Sleep(2) '延迟一会。避免卡顿 Next a.Abort() '停止一会 End Sub Private Sub TureShowNumber(ByVal str As String) '被委托事件 TextBox1.Text &= str End Sub
吉公网安备 22020202000301号