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

c# 获取 系统性能计数器的 值

  为什么 我获取的值都是 零的  希望高手解决 呵呵 

using System; 
using System.Collections.Generic; 
using System.ComponentModel; 
using System.Data; 
using System.Drawing; 
using System.Text; 
using System.Windows.Forms; 
using System.Diagnostics; 

namespace WindowsApplication2 

    public partial class Form1 : Form 
    { 
      // 实例一个计数器 
        private static PerformanceCounter mIdle = new PerformanceCounter("Process", "% Processor Time", "Idle"); 

    
        public Form1() 
        { 
            InitializeComponent(); 
            double dd = mIdle.NextValue(); 
            MessageBox.Show(dd.ToString()); 
        } 
    } 
} --------------------编程问答-------------------- 还有兄弟会啊 绑个忙啥
补充:.NET技术 ,  C#
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,