private void SaveOutputBtn_Click(object sender, EventArgs e) { List <List <int> > outp = GetOutput(); if (outp.Count == 0) { MessageBox.Show("нет данных", "Error"); return; } if (saveFileDialog.ShowDialog() == DialogResult.OK) { try { FileTools file = new FileTools(saveFileDialog.FileName); file.BinWriterOpen(); for (int i = 0; i < outp.Count; i++) { file.WriteBinList(outp[i]); } file.Close(); } catch (Exception ex) { MessageBox.Show(ex.Message, "Error"); } } }
private void OpenInputBtn_Click(object sender, EventArgs e) { try { if (openFileDialog.ShowDialog() == DialogResult.OK) { FileTools file = new FileTools(openFileDialog.FileName); file.BinReaderOpen(); Input.Text = String.Join(" ", file.ReadBinListDouble()); file.Close(); } } catch (Exception ex) { MessageBox.Show(ex.Message, "Error"); } }
private void OpenOutputFile_Click(object sender, EventArgs e) { if (openFileDialog.ShowDialog() == DialogResult.OK) { try { FileTools file = new FileTools(openFileDialog.FileName); file.BinReaderOpen(); StringBuilder sb = new StringBuilder(); while (!file.End) { sb.AppendLine(String.Join(" ", file.ReadBinListDouble())); } Output.Text = sb.ToString(); file.Close(); } catch (Exception ex) { MessageBox.Show(ex.Message, "Error"); } } }
private void SaveInputBtn_Click(object sender, EventArgs e) { try { List <double> inp = GetInput(); if (inp.Count == 0) { MessageBox.Show("нет данных", "Error"); return; } if (saveFileDialog.ShowDialog() == DialogResult.OK) { FileTools file = new FileTools(saveFileDialog.FileName); file.BinWriterOpen(); file.WriteBinList(inp); file.Close(); } } catch (Exception ex) { MessageBox.Show(ex.Message, "Error"); } }