I am trying to programmatically check for the most used programs on my PC using C#. How can I achieve this?
You may need to use System.Diagnostics.Process.GetProcesses()
in order to get information on running processes in a PC. You can design the program as a Windows service application
as explained in the link so that it can start in the background with startup.
The program can call the mentioned method periodically to get running program list and you can count each program duration by multiplying checking period with the number of occurences of a specific process.
Optionally, you can store this duration data into a usage log and you can update this log with a specified time period.
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.