I hate to answer my own question, but no one has answered this...
Unfortunately, as it turns-out, you cannot directly update the Status
field, as it is READ-ONLY. However, you can PAUSE the service, like so:
var serviceController = new ServiceController(ServiceName);
serviceController.Pause(); // Pauses the service
serviceController.Refresh(); // Refreshes the Dialog UI with the new Status
This is unfortunate, as there is no "real" way to show a FAULT-STATE for the service.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.