解决方案 »
- 位数不够补零
- 打印问题请教!
- 请教大家C#怎么做出流畅图片滚动效果?
- 100分求高手解决ClickOne部署问题 : 部署和应用程序没有匹配的安全区域, 送美女QQ!
- 点左侧Treeview中的不同项,右侧页面显示不同内容,该怎么实现?
- 问个树的算法!?
- 又要来砸分求助高手了,很简单的一段异步代码,哪位高手帮我运行下啊,为什么点完启动点停止就会有那些异常啊
- string怎么转为int32
- ★★★★★关于C#中打印预览的问题?超难解决,请对打印相当了解的高手进来.
- COM+ 远程访问问题
- 是否可以通过C#实现更改登陆域的用户及其权限??
- 怎么样把DataSet里的表的 当前行的下一行 设置为 当前行?(也就是移动行指针)
using System.Diagnostics;
using System.Threading;
public class CpuLoadInfo
{ // auxiliary print methods
private static void Say ( string txt )
{
Console.WriteLine(txt);
} // auxiliary print methods
private static void Say()
{
Say("");
} // The main method. Command line arguments are ignored.
[STAThread]
public static void Main()
{
Say("$Id: CpuLoadInfo.cs,v 1.2 2002/08/17 17:45:48 rz65 Exp $");
Say(); Say("Attempt to create a PerformanceCounter instance:");
Say("Category name = " + CategoryName);
Say("Counter name = " + CounterName);
Say("Instance name = " + InstanceName);
PerformanceCounter pc
= new PerformanceCounter(CategoryName,CounterName,InstanceName);
Say("Performance counter was created.");
Say("Property CounterType: " + pc.CounterType);
Say(); Say("Property CounterHelp: " + pc.CounterHelp);
Say();
Say("Entering measurement loop."); while (true)
{
Thread.Sleep(1000); // wait for 1 second
float cpuLoad = pc.NextValue();
Say("CPU load = " + cpuLoad + " %.");
}
} // constants used to select the performance counter.
private const string CategoryName = "Processor";
private const string CounterName = "% Processor Time";
private const string InstanceName = "_Total";
}
http://www.csdn.net/Develop/Read_Article.asp?Id=3664