代码:
ThreadPool.SetMaxThreads(100, 100);ThreadPool.QueueUserWorkItem((obj) =>{ MessageBox.Show("执行线程中的代码");});Thread.Sleep(1000);int n = 8;ThreadPool.QueueUserWorkItem((obj) =>{ MessageBox.Show("传入的参数是:" + Convert.ToInt32(obj));}, n);
本文共 301 字,大约阅读时间需要 1 分钟。
代码:
ThreadPool.SetMaxThreads(100, 100);ThreadPool.QueueUserWorkItem((obj) =>{ MessageBox.Show("执行线程中的代码");});Thread.Sleep(1000);int n = 8;ThreadPool.QueueUserWorkItem((obj) =>{ MessageBox.Show("传入的参数是:" + Convert.ToInt32(obj));}, n);
转载于:https://www.cnblogs.com/s0611163/p/6168990.html