c# の 非同期処理( async /await )を Task で待つ

● task.Wait() で待つ

var task = accessor.GetResponseAsync("http://hatenablog.com/");
task.Wait();

● task.Result の取得で待つ

var task = accessor.GetResponseAsync("http://hatenablog.com/");
string result = task.Result;

引用: https://hiroronn.hatenablog.jp/entry/20171005/1507207811

No.1754
05/14 15:20

edit