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); }
public Form3() { InitializeComponent(); PerformanceCounterMEM.InstanceName = Process.GetCurrentProcess().ProcessName; GaugeCPU.To = 100; GaugeMem.To = PerformanceInfo.GetPhysicalAvailableMemoryInMiB(); }