请问用c#如何获得cpu型号和系统盘剩余空间?
rt
------解决方案--------------------
空闲空间:
ManagementObjectSearcher query;
ManagementObjectCollection queryCollection;
string sql = "Select * from Win32_LogicalDisk Where DriveType = 3";
query = new ManagementObjectSearcher(sql);
queryCollection = query.Get();
foreach (ManagementObject mo in queryCollection)
{
MessageBox.Show(mo["DeviceID"].ToString());
MessageBox.Show(mo["FreeSpace"].ToString());
}