Saint
Saint

Reputation: 5469

How to detect WindowsService properties changes?

How to detect change of the ServiceStartMode property in WindowsService? At start is Automatic, but later someone change it to Manual - how to catch this event?

Upvotes: 0

Views: 69

Answers (1)

Tommaso Belluzzo
Tommaso Belluzzo

Reputation: 23685

You can't detect a change of service StartMode as there are no events linked to that particular situazion... however, using System.Management features you can at any time check the current StartMode of a service and eventually change it. Please, have a look at this very good snippet which implements a full features class which allow you to manipulate this.

Upvotes: 1

Related Questions