Hi. In C#, how do I check if, for example, calculator is running (calc.exe) in task manager process? and how do I end the calc.exe process? Thank you.
dtvonly
0
Newbie Poster
Recommended Answers
Jump to PostVery simple. Just loop through the processes list and check the name of the current process:
//don't forget: using System.Diagnostics; try { Process[] p = Process.GetProcesses();//system processes in an array for (int i = 0; i < p.Length; i++) { if (p[i].ProcessName == "calc")//checkcurrent process name { …
All 2 Replies
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.