How to

continue a windows service

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

This example requires reference to System.ServiceProcess.

Import namespace

using System.ServiceProcess;

Code

ServiceController controller = new ServiceController("ServiceName");
if (controller.Status == ServiceControllerStatus.Paused)
{
    controller.Continue();
}
Send us feedback about this snippet »



Related Snippets: