简体   繁体   中英

Checking if an application is running using Windows Service

I want to check if a particular application is running on my system using a windows service and if not I need to intimate the user about the same? Please suggest a solution. Thanks in advance.

Windows服务和IIS进程的Environment.UserInteractive为false(或者通常:当无法显示UI时)。

You can use ServiceController

var controller = new ServiceController(processName);

and then investigate the controller.

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