public void button1_Click(object sender, EventArgs e) { Cfg.username = textBox1.Text; Cfg.password = textBox2.Text; Cfg.device = comboBox1.Text; Cfg.store = checkBox1.Checked; Cfg.auto = checkBox2.Checked; if (checkBox1.Checked) { Cfg.Commit(); } else { Cfg.username = null; Cfg.password = null; Cfg.store = false; Cfg.auto = false; Cfg.Commit(); } RefComm.StartAuthThread(Cfg.username, Cfg.password, "\\Device\\NPF_" + NetworkInterfaceAvaliable.adapters_dict[Cfg.device], Cfg.VersionParser(Cfg.versionHEX), Cfg.H3C_key, Cfg.mode); button1.Enabled = false; button2.Enabled = true; panel1.Enabled = false; textBox3.Text = ""; timer1.Enabled = true; }
private void modeButton3_CheckedChanged(object sender, EventArgs e) { if (modeButton3.Checked) { Cfg.mode = 2; Cfg.Commit(); } }
private void button1_Click(object sender, EventArgs e) { if (textBox1.Text.Length % 2 != 0 || textBox1.Text.Length > 32 || textBox1.Text.Length < 2) { MessageBox.Show("输入版本号信息不正确!"); textBox1.Text = ""; } else if (textBox3.Text.Length > 20) { MessageBox.Show("输入密钥过长!"); textBox1.Text = ""; } else { Cfg.versionHEX = textBox1.Text; Cfg.H3C_key = textBox3.Text; Cfg.Commit(); textBox2.Text = Cfg.VersionParser(textBox1.Text); textBox4.Text = Cfg.H3C_key; } }