我有一個窗口服務,我想知道什麼時候不工作不是每個XX分鐘左右,但是當它停止當我的Windows服務無法正常工作
我有這個方法我如何知道
public string ServiceStatus()
{
switch (_service.Status)
{
case ServiceControllerStatus.Running:
return "Running";
case ServiceControllerStatus.Stopped:
return "Stopped";
case ServiceControllerStatus.Paused:
return "Paused";
case ServiceControllerStatus.StopPending:
return "Stopping";
case ServiceControllerStatus.StartPending:
return "Starting";
default:
return "Status Changing";
}
}
對不起我的英文不好