[英]How Do I Update the Status of Service in the Windows Dialog
我不想回答我自己的問題,但是沒人回答這個問題。
不幸的是,由於它的結果是只讀,因此您無法直接更新“ Status
字段。 但是,您可以暫停服務,如下所示:
var serviceController = new ServiceController(ServiceName);
serviceController.Pause(); // Pauses the service
serviceController.Refresh(); // Refreshes the Dialog UI with the new Status
這是不幸的,因為沒有“真正”的方式來顯示服務的故障狀態。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.