Hello All,
I've been researching this for the past couple weeks and it seems everyone has a different way of doing things so I needed an opinion.
I'm making a little application for a school project that grabs the following data:
- CPU Utilization
- Amount of System Memory & Amount Free
- Size of Hard Drive & Amount Free
- Network Utilization
- Services Running
- Processes running
I am making a customer user control that will house all of this information so I'd like to be able to call up all this information in that user control class. The idea is to create a seperate instance of the class for each computer and feed it the IP Address or Computer name as a string argument. The way that seems easiest to me so far is something like this:
Dim processorUtilization as New System.Diagnostics.PerformanceCounter
With processorUtilization
.CategoryName = "Processor"
.CounterName = "% Processor Time"
.InstanceName = "_Total"
.MachineName = machineName <-- this is the string variable I would pass in.
Is there an easier/more effective/more efficient way of doing things? I tried this on my computer and kept getting 0 for the cpu utilization so there is obviously SOMETHING else I need to do.
Anyone with this type of experience please let me know what direction I should go.
thanks
I've been researching this for the past couple weeks and it seems everyone has a different way of doing things so I needed an opinion.
I'm making a little application for a school project that grabs the following data:
- CPU Utilization
- Amount of System Memory & Amount Free
- Size of Hard Drive & Amount Free
- Network Utilization
- Services Running
- Processes running
I am making a customer user control that will house all of this information so I'd like to be able to call up all this information in that user control class. The idea is to create a seperate instance of the class for each computer and feed it the IP Address or Computer name as a string argument. The way that seems easiest to me so far is something like this:
Dim processorUtilization as New System.Diagnostics.PerformanceCounter
With processorUtilization
.CategoryName = "Processor"
.CounterName = "% Processor Time"
.InstanceName = "_Total"
.MachineName = machineName <-- this is the string variable I would pass in.
Is there an easier/more effective/more efficient way of doing things? I tried this on my computer and kept getting 0 for the cpu utilization so there is obviously SOMETHING else I need to do.
Anyone with this type of experience please let me know what direction I should go.
thanks