views:

137

answers:

1

Is there a way to programmatically determine how busy a physical disk is in C# without using a System.Diagnostics.PerformanceCounter?

I ask because the documentation for System.Diagnostics.PerformanceCounter states that the user requires elevated priveleges and must be adminitrator or member of performance counters user group. I have neither of those as an option and must assume that the user is running my process in a user account.

My gut feel is that any process running under a non-admin user account is going to have limited, if any, access to information about the system...

+4  A: 

I don't know of an alternative, and if the PerformanceCounter require elevated privileges, I don't see why a possible alternative would not =)

Is it not an option to create a service that runs with elevated privileges, which exposes the information you're interested in through an API of your own?

David Hedlund
@David I think you're probably right on anything else needing same sort of privileges. The service idea is not bad, but massive overkill for what I'm using the data for at the moment. cheers anyway
Neil Fenwick