private void addButton_Click(object sender, EventArgs e) { var net = networkComBox.SelectedItem as System.Net.NetworkInformation.NetworkInterface; var model = IpSwitchHelper.CreateDefault(net?.Id); nameMaskedTextBox.Text = "新方案" + (itemListBox.Items.Count + 1); ipMaskedTextBox.Text = model.IpAddress; subnetMaskedTextBox.Text = model.SubnetMask; gateMaskedTextBox.Text = model.Gateway; dnsMaskedTextBox.Text = model.DNS; idMaskedTextBox.Text = tempId; itemListBox.SelectedIndex = -1; }