Click here to Skip to main content
15,890,512 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I guess it's possible to do using performanceCounter..
Please, help.
EDIT: "Write operations" or "records count", I don't know how to say correctly, because my OS is non-English. Just what you see in process list of your Task Manager, that is what I trying to do. Or by another words:
if you copied one file, this counter for explorer.exe +=1;
Posted
Updated 18-Dec-10 3:37am
v2
Comments
Abhinav S 18-Dec-10 8:11am    
I'm afraid your question is not very clear. You need to know the count of processes - but what do you mean by write operation?
JOAT-MON 18-Dec-10 8:41am    
Are you trying to ask how to get a count of all the write operations for a list of one or more processes?

1 solution

I believe you want to track whenever a process writes something to a file. If you do not, following will not help.

I think you will need a combination of FileSystemWatcher and ProcessModulesCollection. First you need to set up a watcher to see whenever something is written to a file. Then, you will need to iterate through the Process.Modules collection to find if that process has locked the file. Seems a very inefficient and incorrect in some cases way to me but that is what I could come up with for now. May be someone can better my solution. :)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900