|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Announcements
Chapters
Services
Feature Zones
|
Note: This is an unedited contribution. If this article is inappropriate,
needs attention or copies someone else's work without reference then please
Report This Article
IntroductionThis article demonstrates how to use WMI (Windows Management Instrumentation) in C#, to retrieve several types of information about the processor, such as the CPU clock speed, Voltage, Manufacturer, and other properties. Included in the first .zip is the executable polls your system for all the implemented properties. The bench-marker looks like this: BackgroundIt seems that WMI is an unknown concept to many beginners and maybe it intimidates the somewhat more advanced ones. On the MSDN forums there are several questions on how to get CPU/Harddrive information. In this article I will demonstrate how to get a handful of CPU related properties, beginning on what hopefully will become a series of WMI articles/wrappers in the near future. Using the CodeTo use the wrapper, download the .cs file and place it in your application's solution folder: WMI_ProcessorInformationWrapper.zip - 901 B. Next add a using reference to the namespace:
the last step is to call one of the static methods like this:
Future Wrappers
WMI is very powerfull and can be used to get the properties of many different system components such as:
Do you have any specific WMI wrapper you would like to see for C#? If so just drop a comment at this article and I'll try to get it written! P.S. As this is my first article please cut me at least a little slack, but I am NOT opposed to constructive critisism and we'll have an article version at 2.5 before you know it. HistoryV 0.9 ~Initial release.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||