Can a Windows service stop itself?

Viewed 25110

I have a Windows service whose startup type is automatic, but I want to do some checks when the service starts, and have the service stop automatically if these checks fail.

How can I do this? My service is written in C#.

2 Answers
Related