private void Button_Click(object sender, RoutedEventArgs e) { Log_File = new StreamWriter("Log_File.txt", true); try { // Проверка на корректность вводимых данных if (Test_IP_and_Mac() > 0) { Log_File.Close(); return; } if (radio == false) { // ST APTest Test = new APTest(textbox4.Text, textbox3.Text, textbox2.Text, password, gateway_IP, mask_IP); //Test.fwupdate(host, name, pass); Test.conf_update(host, name, pass); } if (radio == true) { // AP textbox2.Text = APTest.get_mac(host, name, pass); APTest Test = new APTest(textbox1.Text, textbox3.Text, password, gateway_IP, mask_IP); //Test.fwupdate(host, name, pass); Test.conf_update(host, name, pass); } System.Windows.MessageBox.Show("Программирование прошло успешно", "Сообщение", MessageBoxButton.OK, MessageBoxImage.Information, MessageBoxResult.OK, MessageBoxOptions.ServiceNotification); if (radio) { Log_File.WriteLine("Успешное программирование Access Point. \n\tIP:" + textbox1.Text); } else { Log_File.WriteLine("Успешное программирование Station. \n\tIP:" + textbox4.Text); } Log_File.Close(); } catch (Exception el) { string er = el.ToString(); MessageBox.Show(er); Log_File.WriteLine("Исключение: " + er); System.Windows.MessageBox.Show("Повторите попытку" + "ещё раз", "Инфо", System.Windows.MessageBoxButton.OK, System.Windows.MessageBoxImage.Information, System.Windows.MessageBoxResult.OK, System.Windows.MessageBoxOptions.ServiceNotification); //Close(); Log_File.Close(); } }
private void Button_Click_FW(object sender, RoutedEventArgs e) { APTest.fwupdate(host, name, pass); System.Windows.MessageBox.Show("Залив прошивки успешный. Дождитесь обнаружения устройства", "Сообщение", MessageBoxButton.OK, MessageBoxImage.Information, MessageBoxResult.OK, MessageBoxOptions.ServiceNotification); }