private void button2_Click(object sender, EventArgs e)
{
string btnName = button2.Text;
if (btnName == "启动")
{
isCancel = false;
button2.Enabled = false;
var t = new Task(() => TaskBoot("TaskBoot"));
t.Start();
button2.Text = "停止";
button2.Enabled = true;
}
else
{
isCancel = true;
isComple = true;
button2.Enabled = true;
button2.Text = "启动";
}
}
static void TaskBoot(string name)
{
int taskCount = 5;
taskList = new Task[taskCount];
int taskCurrent;
int rwCount = 20; //要执行总任务数
int rwNum = 0;