How to

get status of windows service

Published: 26. January 2009 | Updated: 26. September 2011
License: Microsoft Public License (MS-PL)
Categories: Windows » Services
Tags: C# Services Windows
Was this snippet helpful for you? YESYES / NONO

Import namespace

using System.ServiceProcess;

Code

ServiceController service = new ServiceController("Eventlog");
Console.WriteLine(service.Status);
Send us feedback about this snippet »



Related Snippets: