RT:
麻烦解释下 我看好多程序都要用这个 好像获取什么CPU 温度什么的··都是用这个
然后 求详解教程
麻烦解释下 我看好多程序都要用这个 好像获取什么CPU 温度什么的··都是用这个
然后 求详解教程
解决方案 »
- 初学者提问 app.config的xml文件 程序中要写 的congfigmanager.cs文件,以及log ,log4net的关系
- 关于dataset中的update()
- 关于对象序列化的一个问题,急..
- 关于winform查询数据后 改变参数后查询的结果还是老样子问题
- 实例化时的问题
- 如何将3万条纪录分写到若干个xml文件中去
- 请教如何将C#中的ARGB颜色值转换成VB中的&H8000000F&这样的格式?
- 线程问题:如何把播放声音放入线程?
- Microsoft Visual Studio 文档 无法显示网页
- 大神们,帮帮忙啊,必须声明标量变量 "@username"
- c# 实现FTP的文件上传,总连不上,快要崩溃了,往大家帮忙
- 我用foreach遍历目录中的图片时,怎么是乱序的?
没用到过不知道你说的哪个api....r看看这个
using System.Collections.Generic;
using System.Text; /// <summary>
/// Defines an abstract base class for implementations of CPU usage counters.
/// </summary>
public abstract class CpuUsage
{
/// <summary>
/// Creates and returns a CpuUsage instance that can be used to query the CPU time on this operating system.
/// </summary>
/// <returns>An instance of the CpuUsage class.</returns>
/// <exception cref="NotSupportedException">This platform is not supported -or- initialization of the CPUUsage object failed.</exception>
public static CpuUsage Create()
{
if (m_CpuUsage == null)
{
if (Environment.OSVersion.Platform == PlatformID.Win32NT)
m_CpuUsage = new CpuUsageNt();
//else if (Environment.OSVersion.Platform == PlatformID.Win32Windows)
// m_CpuUsage = new CpuUsage9x();
else
throw new NotSupportedException();
}
return m_CpuUsage;
}
/// <summary>
/// Determines the current average CPU load.
/// </summary>
/// <returns>An integer that holds the CPU load percentage.</returns>
/// <exception cref="NotSupportedException">One of the system calls fails. The CPU time can not be obtained.</exception>
public abstract int Query();
/// <summary>
/// Holds an instance of the CPUUsage class.
/// </summary>
private static CpuUsage m_CpuUsage = null;
}