Exemplo n.º 1
0
 private void btn_irda_save_Click(object sender, EventArgs e)
 {
     Regedit.SaveDevicePara("Irda", "InUse", this.checkBox1.Checked ? "1" : "0");
     Regedit.SaveDevicePara("Irda", "DeviceType", (this.comboBox1.SelectedIndex == 1) ? "1" : "0");
     Regedit.SaveDevicePara("Irda", "DeviceNo", this.txt_irda_deviceno.Text.Trim());
     Regedit.SaveDevicePara("Irda", "Channel", this.txt_irda_channel.Text.Trim());
     MessageBox.Show("保存成功!");
 }
Exemplo n.º 2
0
 private void btn_scale_save_Click(object sender, EventArgs e)
 {
     if (this.cb_scaletype.Text.Trim() != "")
     {
         if (this.cb_port.SelectedIndex == -1)
         {
             MessageBox.Show("没有可用的Com端口!");
         }
         else
         {
             Regedit.SaveDevicePara("Scale", "Type", this.cb_scaletype.SelectedIndex.ToString());
             Regedit.SaveDevicePara("Scale", "Port", this.cb_port.Text.Trim().Substring(3));
             Regedit.SaveDevicePara("Scale", "BaudRate", this.cb_bautrate.Text.Trim());
             Regedit.SaveDevicePara("Scale", "DataBits", this.cb_databits.Text.Trim());
             Regedit.SaveDevicePara("Scale", "StopBits", this.cb_stopbits.SelectedIndex.ToString());
             Regedit.SaveDevicePara("Scale", "Parity", this.cb_parity.SelectedIndex.ToString());
             MessageBox.Show("保存成功!");
         }
     }
 }