Neil Fenwick
Neil Fenwick

Reputation: 6184

How to programmatically determine Hard disk activity without using performance monitors

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...

Upvotes: 3

Views: 1161

Answers (1)

David Hedlund
David Hedlund

Reputation: 129792

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?

Upvotes: 4

Related Questions