The following events are not generated, but you can use it together with a timer to display information in the tray (in accordance with the comments):
using System.Diagnostics;
private PerformanceCounter diskRead = new PerformanceCounter();
private PerformanceCounter diskWrite = new PerformanceCounter();
diskRead.CategoryName = "PhysicalDisk";
diskRead.CounterName = "Disk Reads/sec";
diskRead.InstanceName = "_Total";
diskWrite.CategoryName = "PhysicalDisk";
diskWrite.CounterName = "Disk Writes/sec";
diskWrite.InstanceName = "_Total";
_Total for ALL disks ... for specific names of available disks:
var cat = new System.Diagnostics.PerformanceCounterCategory("PhysicalDisk");
var instNames = cat.GetInstanceNames();
you can create a pair diskRead/ diskWritefor each instance of interest to you ... for an example of how to use this in combination with a timer, see this .
Yahia source
share