 //using Microsoft.Win32;
 //using Microsoft.Win32; public void GetComList()
        public void GetComList() {
        { RegistryKey keyCom = Registry.LocalMachine.OpenSubKey("Hardware\\DeviceMap\\SerialComm");
            RegistryKey keyCom = Registry.LocalMachine.OpenSubKey("Hardware\\DeviceMap\\SerialComm"); if (keyCom != null)
            if (keyCom != null) {
            { string[] sSubKeys = keyCom.GetValueNames();
                string[] sSubKeys = keyCom.GetValueNames(); this.cmbComPort.Items.Clear();
                this.cmbComPort.Items.Clear(); foreach (string sName in sSubKeys)
                foreach (string sName in sSubKeys) {
                { string sValue = (string)keyCom.GetValue(sName);
                    string sValue = (string)keyCom.GetValue(sName); this.cmbComPort.Items.Add(sValue);
                    this.cmbComPort.Items.Add(sValue); }
                } }
            } }
        }  
                    
                     
                    
                 
                    
                 
         
        
 
             
                
            
         浙公网安备 33010602011771号
浙公网安备 33010602011771号