■ 윈도우즈 서비스 배열을 구하는 방법을 보여준다.
▶ 예제 코드 (C#)
1 2 3 4 5 6 7 8 9 10 11 12 13 |
using System.ServiceProcess; ServiceController[] serviceControllerArray = ServiceController.GetServices(); foreach(ServiceController serviceController in serviceControllerArray) { if(serviceController.Status == ServiceControllerStatus.Running) { // 코드를 수행한다. } } |