VB.NET 多线程建立运行

页面导航:首页 > 软件编程 > vb.net > VB.NET 多线程建立运行

VB.NET 多线程建立运行

来源: 作者: 时间:2016-01-18 16:54 【

代码示例,方便以后查阅Private Sub Start_1() #39;线程1 Dim I As Integer For I = 1 To 100000000 Step +1 Label1.Text = I Next End Sub Private Sub Start_2() #39;线程2 Dim ...

 

代码示例,方便以后查阅

 Private Sub Start_1() '线程1

        Dim I As Integer

        For I = 1 To 100000000 Step +1

            Label1.Text = I

        Next

    End Sub

 

    Private Sub Start_2() '线程2

        Dim I As Integer

        For I = 100000000 To 1 Step -1

            Label2.Text = I

        Next

    End Sub

 

    Private Sub Start_3() '线程3

        Dim I As Integer

        For I = 1 To 100000000 Step +1

            Label3.Text = I

        Next

    End Sub

 

    Private Sub Start_4() '线程4

        Dim I As Integer

        For I = 100000000 To 1 Step -1

            Label4.Text = I

        Next

    End Sub

 

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        Control.CheckForIllegalCrossThreadCalls = False

        Dim XC_1 As New Threading.Thread(AddressOf Start_1)

        XC_1.Start()

        Dim XC_2 As New Threading.Thread(AddressOf Start_2)

        XC_2.Start()

        Dim XC_3 As New Threading.Thread(AddressOf Start_3)

        XC_3.Start()

        Dim XC_4 As New Threading.Thread(AddressOf Start_4)

        XC_4.Start()

    End Sub

 

摘自Shine的圣天堂-〃敏〃

Tags:

文章评论

最 近 更 新
热 点 排 行
Js与CSS工具
代码转换工具

<