需要提供三个函数1、获取系统的总共物理内存(返回long型字节数)
2、获取系统当前使用的物理内存(返回long型字节数)
3、获取系统当前CPU使用率(返回double型,0到1之间)[email protected],哪位高手给个呀,谢谢谢谢谢谢谢谢

解决方案 »

  1.   

    为什么要dll。自己写几个函数就可以了。
      

  2.   

    老三我是搞Java的,所以必须得是dll,否则没法用,谢谢
      

  3.   

    物理内存:http://topic.csdn.net/t/20060220/15/4566076.html
    CPU使用率:http://topic.csdn.net/t/20051114/21/4393153.html自己把它改成Dll就可以了。
      

  4.   


    public partial class Form1 : Form
        {
            PerformanceCounter cpuCounter = new PerformanceCounter("Processor", "% Processor Time", "_Total");         public Form1()
            {
                InitializeComponent();
            }        private void button1_Click(object sender, EventArgs e)
            {
                double cpu = getCurrentCpuUsage();
                double Freemem = getAvailableRAM();
                double usedMem = getCommitedRAM();
            }        public double getCurrentCpuUsage()
            { 
                return cpuCounter.NextValue();
            }         /* 
            Call this method every time you need to get 
            the amount of the available RAM in Mb 
            */ 
            public double getAvailableRAM()
            {       
                PerformanceCounter ramCounter = new PerformanceCounter("Memory", "Available Bytes");
                return ramCounter.NextValue(); 
            } 
            /* 
            Call this method every time you need to get 
            the amount of the available RAM in Mb 
            */ 
            public double  getCommitedRAM()
            {
                PerformanceCounter ramCounter = new PerformanceCounter("Memory", "Committed Bytes");
                return ramCounter.NextValue();
            }     }
      

  5.   

    hoho,找到高手写的Java包了,结帖