stop a windows service
Published: 12. January 2009 | Updated: 12. January 2009License: Microsoft Public License (MS-PL)
Categories: Windows » Services
Tags: C# Services Windows
Snippet code shows how to stop windows service.
Import namespace
using System.ServiceProcess; // add reference to System.ServiceProcess
Code
ServiceController controller = new ServiceController("ServiceName"); controller.Stop();
| Send us feedback about this snippet » |





