答案 0 :(得分:2)
您可以将Task.ContinueWith
与Task.WhenAll
一起使用,也可以使用Task.WaitAll
代码在WaitAll调用后运行。
var executingTask = Task.WhenAll(task1, task2, task3).ContinueWith((antecedent) =>{/*your code*/});
有关其他详细信息,请参阅Task.ContinueWith documentation。
或强>
// WaitAll blocks until all tasks are complete
Task.WaitAll(task1, task2, task3);
/*your code on the following lines(s) which will run after task1,task2,task3 are complete*/