Reputation: 123
I have Windows XP which do not provide the Categories Processor or Memory, and I cannot bring it to show them (I'm not allowed to edit the registry nor to change System Files)
Is there any way to get the actual CPU usage and Free Memory without using PerformanceCounter?
I'm using .NET 3.5
and C#
on Windows XP SP2
Upvotes: 2
Views: 4976
Reputation: 1471
Would you be able to use native win32 API calls? If so then they would provide the information your after.
See the following article: CodeProject: Calling API functions using C#
Upvotes: 1
Reputation: 4621
If you are using .net 4 and you are only interested in what your current app domain is doing then you can use this:
this.AppDomain.MonitoringTotalProcessorTime
See MSDN Documentation MonitoringTotalProcessorTime
Upvotes: 0
Reputation: 6490
To get the Processor usage without performance counter using WMI, Look at win32_Processor class. and if you want to see the total memory available use GC.GetTotalMemory - Process.GetCurrentProcess().PrivateMemorySize64
;
Upvotes: 2