Bandwidth usage given a process id
Posted on 2004-08-14
Given a process id I can get reference to Process object by
int processID = 0;
//initialize processID from whatever
System.Diagnostics.Process process =
Now what I'd like to do is figure out how much bandwidth that particular process is using up. I know what ports in particular it is using but it would also be nice to know how to figure out what ports a process is using and there current state.
At any rate my main question how do I determine how many bytes, packets, etc that this process is either downloading or uploading?
Code is much appreciated as I just switched over to c# from c++.