日期:2014-05-18  浏览次数:20965 次

请问用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());

}