using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;class Program
{
static void Main(string[] args)
{
List<Action> actions = new List<Action>();
actions.Add(() => Console.WriteLine("A1"));
actions.Add(() => Console.WriteLine("A2"));
actions.Add(() => Console.WriteLine("A3"));
actions.Add(() => Console.WriteLine("A4")); foreach (var action in actions)
{
ThreadPool.QueueUserWorkItem(state => action(), null);
Thread.Sleep(1);
} Console.Read();
}
}
ThreadPool.QueueUserWorkItem(state => action(), null);
state => action()state => action()是什么意思? state这个变量是哪里来的?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货