我有这段代码:
private async void WaitAnyAll(object sender, EventArgs e)
{
var start = new Task(() => { StartAll("Starter"); } );
textBox1.Text += "Before" + Environment.NewLine;
start.Start();
textBox1.Text += "End" + Environment.NewLine;
}
private async Task StartAll(string mssg)
{
textBox1.Text += mssg + Environment.NewLine;
}
哪个输出(在文本TextBox控件中):
Before
End
但我确定应该输出这个:
Before
End
Starter
为什么不这样做?