change - 循环方法添加线程

master
SoulStar 3 months ago
parent b3430a6e54
commit dc02eb7667

@ -69,11 +69,15 @@ namespace NDSD_Screwdriver
MessageBox.Show("属性值无效!");
return;
}
for (int i = 0; i <= 16; i++)
Thread thread = new Thread(() =>
{
DOperate.DClose(i);
Thread.Sleep(span);
}
for (int i = 0; i <= 16; i++)
{
DOperate.DClose(i);
Thread.Sleep(span);
}
});
thread.Start();
}
private void DOpenAll_Click(object sender, EventArgs e)
@ -85,11 +89,15 @@ namespace NDSD_Screwdriver
MessageBox.Show("属性值无效!");
return;
}
for (int i = 0; i <= 16; i++)
Thread thread = new Thread(() =>
{
DOperate.DOpen(i);
Thread.Sleep(span);
}
for (int i = 0; i <= 16; i++)
{
DOperate.DOpen(i);
Thread.Sleep(span);
}
});
thread.Start();
}
private void ScrewdriverTest_FormClosed(object sender, FormClosedEventArgs e)
@ -118,11 +126,15 @@ namespace NDSD_Screwdriver
MessageBox.Show("属性值无效!");
return;
}
for (int i = 0; i <= 16; i++)
Thread thread = new Thread(() =>
{
DOperate.DTimeOpen(i, time);
Thread.Sleep(span);
}
for (int i = 0; i <= 16; i++)
{
DOperate.DTimeOpen(i, time);
Thread.Sleep(span);
}
});
thread.Start();
}
}

Loading…
Cancel
Save