用线程实现控制台输出1-9999的数

it2022-05-05  132

using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Diagnostics; using System.Drawing; using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; using System.Windows.Forms; namespace 进程窗体练习 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { Thread th = new Thread(test); th.IsBackground = true; th.Start(); } public void test() { for (int i = 0; i < 10000; i++) { Console.WriteLine(i); } } } }

 


最新回复(0)