Click here to Skip to main content
15,895,142 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
What is the best class(es) to use to get the properties of the system your app is running on.

For example:

Total RAM
Video Card
Detailed CPU info
etc.

I have tried some articles but the classes they suggest are either obsolete or incomplete.

Thanks.
Posted
Comments
shakil0304003 21-Nov-10 1:29am    
You can give your code, what you tried?

PerformanceCounter Class:

C#
using System;
using System.Diagnostics;

class app
{
   static void Main ()
   {
       var pc = new PerformanceCounter ("Memory", "Available MBytes");
       Console.WriteLine ("Available RAM : {0}", pc.RawValue);
   }
}


This works but I could not find a list of the valid Categories and Items to get other information I wanted. I did find the C# doc on the class and the members but it did not have that level of detail.

This was the closest. Others I found were for classes that are now obsolete.

If you know another class or how to get the enumeration for the categories and items of this class?

I can get some basics from the Environment Class, but not much about the hardware.

Thanks for the reply.
 
Share this answer
 
I was able to write an enumerator for the Categories, Instances, and Counters for the PerfomanceCounter Class. It offers some information in the Memory and PhysicalDisk categories. It is not really the Class that I need to get the hardware details on the system.

I am going to post a similar question on the forum and try there.

Thanks for the help.
 
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