So ServiceController.WaitForStatus is a blocking call. How can it be done Task/Async manner?
相关问题
- Generic Generics in Managed C++
- How to Debug/Register a Permanent WMI Event Which
- 'System.Threading.ThreadAbortException' in
- Bulk update SQL Server C#
- Should I use static function in c# where many call
The code for
ServiceController.WaitForStatus
is:This can be converted to a task based api using the following:
Or with support for a
CancellationToken