cae*_*say 5 .net c# system-monitoring
我正在寻找一种监控系统统计信息的方法.
我的最终目标是编写一个可用于在后台轻松运行的应用程序,并允许为某些操作设置许多事件,例如:When processer temp gets to 56C -> Do _Blank_等等.
如果代码是另一种.net语言,那没关系.
好吧,我想出了如何获得我的用法!1 下,3 去。
CPU使用率:
using (PerformanceCounter pc = new PerformanceCounter("Processor", "% Processor Time", "_Total"))
{
while (true)
{
Console.WriteLine(pc.NextValue());
Thread.Sleep(100);
}
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1198 次 |
| 最近记录: |