void ramHandler() { ramValue = RAMCounter.NextValue(); RAMIcon.Text = "RAM:" + ramValue.ToString("0.0#") + "%"; Icon temp = new Icon(localPath + "Memory" + ((int)(ramValue / 10)) * 10 + ".ico", 64, 64); RAMIcon.Icon = temp; }
public void UpdateFields() { try { Cpu = Math.Round(CounterCpu.NextValue() / _processorCount, 2); } catch (InvalidOperationException) { } try { RAM = Math.Round(RAMCounter.NextValue() / _total, 2); } catch (InvalidOperationException) { } ThreadNumber = Process.Threads.Count; }