Suspension (not completing the Task) from another panel
-
Is there any way to make the caps (unfinished) due from another car?
for (int i = 0; i < count; i++) { await Task.Run(() => FullReg()); await Task.Delay(5000); if (checkBox1.Checked) { if (i % proxyswitch == 0 && i != 0) { //Task.WaitAll(); -- ТУТ ДОЛЖНА БЫТЬ ПРИОСТАНОВКА ВСЕХ ТАСКОВ System.Diagnostics.Process.Start(@"C:\Program Files (x86)\HMA! Pro VPN\bin\HMA! Pro VPN.exe", "-changeip"); await Task.Delay(10000); } } } while(int.Parse(CountFailedAccLabel.Text) + int.Parse(CountFailedAccLabel.Text) != count) { await Task.Delay(proxyswitch*5000); await Task.Run(() => ChangeIPHMAButton_Click(sender, e)); await Task.Delay(10000); //System.Diagnostics.Process.Start(@"C:\Program Files (x86)\HMA! Pro VPN\bin\HMA! Pro VPN.exe", "-changeip"); }
-
You can't stop another code just like that. This code should cooperate. For example, you can raise a flag that has to be checked in parallel to the running code, or set up a common object that your parallel code has to try to lane off from time to time.