使用vb.net从任务管理器中获取CPU使用历史记录 [英] CPU Usage History from Task Manager using vb.net

查看:275
本文介绍了使用vb.net从任务管理器中获取CPU使用历史记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我正在开发一个应用程序,因为我必须显示CPU使用情况历史记录图和Pagefile使用情况历史记录图.
当我们打开任务管理器时,它将显示窗口,在该性能选项卡中,将显示CPU使用情况历史记录图形和Pagefile使用情况历史记录图形.
如何使用vb.Net从任务管理器中获取这些图形.
如果有人对此有所了解,请提供一些源代码以完成此任务.
为了从taskmanager获得CPU使用速度,我使用以下代码

将m_PerformanceCounter用作新的System.Diagnostics.PerformanceCounter("Processor",%Processor Time","_Total")
Dim cupcount作为字符串= CInt(m_PerformanceCounter.NextValue())& %"
这里m_PerformanceCounter.NextValue()将给出cpu的使用百分比.

如果有人知道如何显示这些图形,请提供一些源代码以完成此任务.

Thanks
pavani

Hi,

I am developing one application in that I have to display CPU usage history graph and Pagefile usage history graph.
When we open task manager it will display window, in that performance tab it will display CPU usage history graph and Pagefile usage history graph.
How to get those graphs from Task manager using vb.Net.
If anybody know about this please provide me some source code to complete this task.
To get the CPU Usage speed from taskmanager I used the following code

Private m_PerformanceCounter As New System.Diagnostics.PerformanceCounter("Processor", "% Processor Time", "_Total")
Dim cupcount As String = CInt(m_PerformanceCounter.NextValue()) & "%"
Here m_PerformanceCounter.NextValue() will gives the cpu usage percentage.

If anybody know about how to display those graphs, please provide me some source code to complete this task.

Thanks
pavani

推荐答案

您将不得不根据值创建图形. CodeProject上有几种图形库,例如 [这一个 [
You''ll have to make the graph youself from the values. There are several graph libraries on CodeProject, such as this one[^] and this one[^].


这篇关于使用vb.net从任务管理器中获取CPU使用历史记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆