当前位置:编程学习 > C#/ASP.NET >>

在C#中,如何知道和获得CPU,内存的使用率

如题,谢谢了 --------------------编程问答-------------------- using System.Diagnostics;
using System.ServiceProcess;

private float CpuInfo()
{
PerformanceCounter pc = new PerformanceCounter("Process", "% Processor Time", "Idle");
float first = pc.NextValue();
Thread.Sleep(1);
float Second = pc.NextValue();
                            return Second;
} --------------------编程问答-------------------- 同楼上,这里有个源码:http://www.cnpopsoft.com/article.asp?id=54
补充:.NET技术 ,  C#
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,