Exemplo n.º 1
0
        private void Timer_Tick(object sender, EventArgs e)
        {
            GaugeMem.To = PerformanceInfo.GetPhysicalAvailableMemoryInMiB();

            GaugeCPU.Value = Convert.ToInt32(PerformanceCounterCPU.NextValue());
            GaugeMem.Value = Convert.ToInt32(PerformanceCounterMEM.NextValue() / 1024 / 1024);
        }
Exemplo n.º 2
0
        public Form3()
        {
            InitializeComponent();

            PerformanceCounterMEM.InstanceName = Process.GetCurrentProcess().ProcessName;

            GaugeCPU.To = 100;
            GaugeMem.To = PerformanceInfo.GetPhysicalAvailableMemoryInMiB();
        }