本文实例讲述了C#获取硬盘编号的方法。分享给大家供大家参考。具体实现方法如下: ManagementClass mc = new ManagementClass(Win32_PhysicalMedia); //Win32_DiskDrive不包含SerialNumber属性。 ManagementObjectCollection moc = mc.GetInstances(); string strID = null ; foreach( ManagementObject mo in moc ) { strID = mo.Properties[SerialNumber].Valu