Async/Await implementation of WebBrowser class for .NET

前端 未结 4 1305
后悔当初
后悔当初 2020-12-05 08:34

Longtime reader, first-time poster here.

My goal: To be able to take advantage of async/await while using the WebBrowser class. As the WebBrowser.Navigate(string ur

4条回答
  •  星月不相逢
    2020-12-05 08:58

    You can use TaskCompletionSource to create a Task and mark it as completed later.

    I don't see any alternative for the non-generic task, but as Task derives from Task, you could just use a TaskCompletionSource and set the result to null.

    提交回复
    热议问题