How to get the CPU Usage in C#?

后端 未结 10 1985
醉酒成梦
醉酒成梦 2020-11-22 06:22

I want to get the overall total CPU usage for an application in C#. I\'ve found many ways to dig into the properties of processes, but I only want the CPU usage of the proce

10条回答
  •  不思量自难忘°
    2020-11-22 06:55

    You can use WMI to get CPU percentage information. You can even log into a remote computer if you have the correct permissions. Look at http://www.csharphelp.com/archives2/archive334.html to get an idea of what you can accomplish.

    Also helpful might be the MSDN reference for the Win32_Process namespace.

    See also a CodeProject example How To: (Almost) Everything In WMI via C#.

提交回复
热议问题