查看: 2118|回复: 0

[ASP.NET教程] c# 启动线程的方式

发表于 2018-4-25 08:00:02

//不带参数的启动方式

scanThread = new Thread(new ThreadStart(startThread));
scanThread.IsBackground = true;
scanThread.Start();

//带参数的启动方式

endThread = new Thread(new ParameterizedThreadStart(endThread));
endThread.IsBackground = true;
endThread.Start(param);

ThreadPool.QueueUserWorkItem(new WaitCallback(startThread), param);



回复

使用道具 举报