static void Main(string[] args)
{
for (int i = 0; i < 5; i++)
{
System.Threading.Thread t = new System.Threading.Thread(test);
t.SetApartmentState(System.Threading.ApartmentState.STA); --------换成MTA 效果是一样的
t.Start();
}
Console.ReadLine();
}
[STAThread]
static void test()
{
Console.WriteLine("进来了"); System.Threading.Thread.Sleep(2000); Console.WriteLine("出去了");
}
{
for (int i = 0; i < 5; i++)
{
System.Threading.Thread t = new System.Threading.Thread(test);
t.SetApartmentState(System.Threading.ApartmentState.STA); --------换成MTA 效果是一样的
t.Start();
}
Console.ReadLine();
}
[STAThread]
static void test()
{
Console.WriteLine("进来了"); System.Threading.Thread.Sleep(2000); Console.WriteLine("出去了");
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货