110,533
社区成员
发帖
与我相关
我的任务
分享
private void button2_Click(object sender, EventArgs e)
{
Thread t1 = new Thread(
() =>
{
for (int i = 0; i < 10; i++)
{
Console.WriteLine(i);
Thread.Sleep(2000);
}
Console.WriteLine("前台第二线程马上关闭");
}
) { IsBackground = false};
Console.WriteLine("主线程马上关闭");
Application.Exit();
}