1.異步方法的定義
public string GetValue()
{
return "value";
}
public async Task<string> GetValueAsync()
{
string t = await Task.Run(() => GetValue());
return t;
}
2.異步方法的調用
Task<string> t = GetValueAsync();
string value = await t;
