多任务处理与等待
#359
Replies: 2 comments 5 replies
-
[RelayCommand]
private async Task RunTaskAsync()
{
_canScan = false;
var task1 = ScanCodeAsync();
var task2 = RunAsync();
System.Diagnostics.Debug.WriteLine($"等待任务结束 at {DateTime.Now}");
Task.WaitAll(task1, task2);
System.Diagnostics.Debug.WriteLine($"任务结束,执行以下步骤 at {DateTime.Now}");
await Task.Delay(1000);
System.Diagnostics.Debug.WriteLine($"后续工作执行结束 at {DateTime.Now}");
} 这里不应该使用 |
Beta Was this translation helpful? Give feedback.
5 replies
-
果然可以,使用 谢谢 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
你好,现在有个功能:点击按钮后开始执行两个Task,需要等待两个task同时完成后再往下执行,使用wpf开发的功能,现在进行模拟
项目地址在这里:
https://github.com/mzy666888/TaskApp
能帮忙看一下具体问题在哪里吗
Beta Was this translation helpful? Give feedback.
All reactions