vb.net双线程复制 vb timer 多线程
vb.net 多线程操作
将循环放入到另一个线程中
创新互联主要从事成都网站建设、成都网站设计、网页设计、企业做网站、公司建网站等业务。立足成都服务桐梓,十余年网站建设经验,价格优惠、服务专业,欢迎来电咨询建站服务:028-86922220
ThreadStart ts = new ThreadStart(delegate() {
//do something
});
Thread t = new Thread(ts);
t.Start();
//going do something
求写一下vb.net双线程的代码:两个按钮和两个label控件,按钮让label自加,按钮互不干扰
Imports System
Imports System.Threading
Public Class Form1
Dim TestThread1, TestThread2 As Thread
Public Sub TestMethod1()
Dim i As Integer
i = 0
While (i 10)
Label1.Text = i
i += 1
End While
End Sub
Public Sub TestMethod2()
Dim i As Integer
i = 0
While (i 10)
Label2.Text = i
i += 1
End While
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Control.CheckForIllegalCrossThreadCalls = False
TestThread1 = New Thread(New ThreadStart(AddressOf TestMethod1))
TestThread1.Start()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Control.CheckForIllegalCrossThreadCalls = False
TestThread2 = New Thread(New ThreadStart(AddressOf TestMethod2))
TestThread2.Start()
End Sub
End Class
VB.NET怎么复制文件到剪切板,不是复制文件内容!
例如,把文件"E:\新建文件夹\a.txt"复制到剪贴板
CreateObject("Shell.Application").NameSpace("E:\新建文件夹").ParseName("a.txt").InvokeVerb "复制(C)"
当前名称:vb.net双线程复制 vb timer 多线程
文章链接:http://pwwzsj.com/article/dosscco.html