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 OpnBtn_Click(object sender, EventArgs e) { if (openFileDialog.ShowDialog() == DialogResult.OK) { try { FileTools file = new FileTools(openFileDialog.FileName); file.BinReaderOpen(); list = file.ReadBinStudentList(); SetDGV(); } 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"); } } }