0
我有我想要停止使用progrmatically一個ServiceController.Stop()
窗口服務:ServiceController.Stop()無法停止服務
ServiceController sc = new ServiceController(<ServiceName>);
sc.Stop();
sc.Refresh();
然而,當我看到在服務列表中該服務,其狀態仍仍然是「開始」。如果我將方法sc.WaitForStatus()
等待狀態更改爲「已停止」,則永遠不會達到此狀態。
怎麼回事?
如果您嘗試從服務列表中停止它,這是否工作? – 2011-01-27 08:01:34