标签:task 调用 异步 value str wait string arp 方法
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;
标签:task 调用 异步 value str wait string arp 方法
原文地址:https://www.cnblogs.com/by-lhc/p/9669699.html