private void refreshText() { string tmp = RefComm.ReadLog(); if (tmp.Length != 0) { if (textBox3.Text.Length > 1024) { textBox3.Text = ""; textBox3.ScrollToCaret(); } textBox3.ScrollToCaret();//自动滚屏 textBox3.AppendText(tmp); textBox3.ScrollToCaret(); } //自动更新IP if (tmp.Contains("Success")) { NetworkInterfaceAvaliable.RefreshDHCP(NetworkInterfaceAvaliable.adapters_dict[comboBox1.Text]); textBox3.AppendText("IP Refreshed.\r\n"); textBox3.ScrollToCaret();//自动滚屏 } }
private void button1_Click(object sender, EventArgs e) { if (NetworkInterfaceAvaliable.adapters_dict.ContainsKey(Cfg.device)) { NetworkInterfaceAvaliable.RefreshDHCP(NetworkInterfaceAvaliable.adapters_dict[Cfg.device]); } else { MessageBox.Show("你没有选择网卡!"); this.Close(); } }