private void Yes_Click(object sender, RoutedEventArgs e) { if (IPStarttextBox_1.Text != "" && IPStarttextBox_2.Text != "" && IPStarttextBox_3.Text != "" && IPStarttextBox_4.Text != "") { string resetIP = IPStarttextBox_1.Text + '.' + IPStarttextBox_2.Text + '.' + IPStarttextBox_3.Text + '.' + IPStarttextBox_4.Text; StaticGlobal.FwMACandIP[StaticGlobal.firewallmac] = resetIP; IResetIP res = new ResetIP(); for (int i = 0; i < StaticGlobal.fwdev_list.Count(); i++) { if (StaticGlobal.fwdev_list[i].getDev_MAC() == StaticGlobal.firewallmac) { if (res.ResetIP(StaticGlobal.fwdev_list[i].getProtecDev_list()[0], resetIP)) { UserMessageBox.Show("提示", "IP重设成功"); StaticGlobal.FwMACandIP[StaticGlobal.firewallmac] = resetIP; } else { UserMessageBox.Show("提示", "无IP模式配置失败!"); } } } this.Close(); ConfigFW update = new ConfigFW(); update.FWIP.Text = StaticGlobal.FwMACandIP[StaticGlobal.firewallmac]; //update.FWIP.AppendText(StaticGlobal.FwMACandIP[StaticGlobal.firewallmac]); } else { UserMessageBox.Show("提示", "请输入正确的IP地址"); } }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.main = ((FireWall.ResetIP)(target)); return; case 2: this.SetIPTitle = ((System.Windows.Controls.TextBlock)(target)); return; case 3: this.IPStarttextBox_1 = ((System.Windows.Controls.TextBox)(target)); #line 17 "..\..\ResetIP.xaml" this.IPStarttextBox_1.TextChanged += new System.Windows.Controls.TextChangedEventHandler(this.textchanged); #line default #line hidden #line 17 "..\..\ResetIP.xaml" this.IPStarttextBox_1.KeyDown += new System.Windows.Input.KeyEventHandler(this.keydown); #line default #line hidden return; case 4: this.sep1 = ((System.Windows.Controls.Label)(target)); return; case 5: this.IPStarttextBox_2 = ((System.Windows.Controls.TextBox)(target)); #line 19 "..\..\ResetIP.xaml" this.IPStarttextBox_2.TextChanged += new System.Windows.Controls.TextChangedEventHandler(this.textchanged); #line default #line hidden #line 19 "..\..\ResetIP.xaml" this.IPStarttextBox_2.KeyDown += new System.Windows.Input.KeyEventHandler(this.keydown); #line default #line hidden return; case 6: this.sep2 = ((System.Windows.Controls.Label)(target)); return; case 7: this.IPStarttextBox_3 = ((System.Windows.Controls.TextBox)(target)); #line 21 "..\..\ResetIP.xaml" this.IPStarttextBox_3.TextChanged += new System.Windows.Controls.TextChangedEventHandler(this.textchanged); #line default #line hidden #line 21 "..\..\ResetIP.xaml" this.IPStarttextBox_3.KeyDown += new System.Windows.Input.KeyEventHandler(this.keydown); #line default #line hidden return; case 8: this.sep3 = ((System.Windows.Controls.Label)(target)); return; case 9: this.IPStarttextBox_4 = ((System.Windows.Controls.TextBox)(target)); #line 23 "..\..\ResetIP.xaml" this.IPStarttextBox_4.TextChanged += new System.Windows.Controls.TextChangedEventHandler(this.textchanged); #line default #line hidden #line 23 "..\..\ResetIP.xaml" this.IPStarttextBox_4.KeyDown += new System.Windows.Input.KeyEventHandler(this.keydown); #line default #line hidden return; case 10: this.label = ((System.Windows.Controls.Label)(target)); return; case 11: this.yes = ((System.Windows.Controls.Button)(target)); #line 27 "..\..\ResetIP.xaml" this.yes.Click += new System.Windows.RoutedEventHandler(this.Yes_Click); #line default #line hidden return; case 12: this.cancle = ((System.Windows.Controls.Button)(target)); #line 28 "..\..\ResetIP.xaml" this.cancle.Click += new System.Windows.RoutedEventHandler(this.cancle_Click); #line default #line hidden return; } this._contentLoaded = true; }