May 18th, 2007
(Diagram: 淺談CIM與WMI-名詞介紹)
WMI (Windows Management Instrumentation) provide a kind of easy way to let you query data from your system (Ex: OS version, share folder name … etc).
It is easy to understand, using WMI to query information is the same with query data from database. You can just using “SELECT * from Win32_Process” to find out all exist process in your computer.
There are some examples which describe how to create it using C# or C++ code.
There are serveral extension reading..
Here is sample code of C#
using System.Management; //This is equivalent to "SELECT * FROM Win32_Service" SelectQuery sysSQL = new SelectQuery("Win32_bios"); > > MnagementObjectSearcher sysRet = new ManagementObjectSearcher(sysSQL); > > // Display each entry for Win32_bios foreach (ManagementObject sysInfo in sysRet.Get()) { this.textBox1.Text = "Bios version: " + sysInfo["version"].ToString(); } > >