D
D
dark_Kelvin2016-01-05 15:47:10
Programming
dark_Kelvin, 2016-01-05 15:47:10

How to get disk usage (I/O speed) of a foreign process in C#?

How to get information about disk loading (disk I/O speed) for someone else's process in windows 7 and XP in C#?
Here is an example of how AnVir shows it .
f0e5f096bd9942edb9ebe952136e0d73.JPG
I tried to pull it out through https://msdn.microsoft.com/en-us/library/windows/d... , it gives out not at all what AnVir on XP

foreach (var obj in new ManagementObjectSearcher("SELECT * FROM Win32_PerfFormattedData_PerfProc_Process").Get())
{
       ulong IODataBytesPerSec = (ulong)obj["IODataBytesPerSec"];
}

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question