定义全局变量:
private Thread t1;
线程内容:
public void Thread1()
{
//这里写线程执行的代码
}
控制线程:
1、启动
t1 = new Thread(new ThreadStart(Thread1));
t1.IsBackground = true;
t1.Start(); //启动线程
2、暂停
t1.Suspend();
3、继续
t1.Resume();
4、终止
t1.Abort();
5、跨线程访问
Control.CheckForIllegalCrossThreadCalls = false;
private Thread t1;
public void Thread1()
{
//这里写线程执行的代码
}1、启动
t1 = new Thread(new ThreadStart(Thread1));
t1.IsBackground = true;
t1.Start(); //启动线程2、暂停
t1.Suspend();3、继续
t1.Resume();4、终止
t1.Abort();5、跨线程访问
Control.CheckForIllegalCrossThreadCalls = false;


浙公网安备 33010602011771号