简体   繁体   中英

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM