String HDid = "";
ManagementClass mc = new ManagementClass("Win32_DiskDrive");
ManagementObjectCollection moc = mc.GetInstances();
foreach (ManagementObject mo in moc)
{
//USB:移动硬盘,U盘;
//IDE:办公电脑的物理硬盘是这种接口
//SCSI:目前发现阿里云主机的硬盘是这种接口
//HDC:?
//1394:?
if (Convert.ToString(mo.Properties["InterfaceType"].Value).ToUpper() == "IDE"
|| Convert.ToString(mo.Properties["InterfaceType"].Value).ToUpper() == "SCSI")
{
//...
}
}
moc = null;
mc = null;
return HDid;
你说IDE跟SCSI是什么意思?