G***l 发帖数: 355 | 1 C#里面异步不要太简单。msdn的例子:
private async void StartButton_Click(object sender, RoutedEventArgs e)
{
// ExampleMethodAsync returns a Task and has an int result.
// A value is assigned to intTask when ExampleMethodAsync reaches
// an await.
try
{
Task intTask = ExampleMethodAsync();
// You can do other work here that doesn't require the result from
// ExampleMethodAsync. . . .
ResultsTextBox.Text += "Doing other work before awaiting intTask. ... 阅读全帖 |
|