public void GetComList(ComboBox cbx) { //初始化COM口到列表 RegistryKey keyCom = Registry.LocalMachine.OpenSubKey("Hardware/DeviceMap/SerialComm"); if (keyCom != null) { string[] sSubKeys = keyCom.GetValueNames(); cbx.Items.Clear(); foreach (string sName in sSubKeys) { string sValue = (string)keyCom.GetValue(sName); cbx.Items.Add(sValue); } } }