private void saveToolStripMenuItem_Click(object sender, EventArgs e) { if (saveFileDialog.ShowDialog() == DialogResult.OK) { try { FileTls fileTls = new FileTls(saveFileDialog.FileName); fileTls.WriteString(Output.Text); } catch (Exception eror) { MessageBox.Show(eror.Message, "ошибка"); } } }
private static void StringFile(string str) { while (true) { try { Console.Write("введите имя файла: "); FileTls fileTls = new FileTls(Console.ReadLine()); fileTls.WriteString(str); return; } catch (Exception eror) { Console.WriteLine(eror.Message); } } }