Advertisement
Guest User

Untitled

a guest
May 28th, 2016
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. private void buttonAbrirArquivo_Click(object sender, EventArgs e)
  2. {
  3. if (openFileDialogPontos.ShowDialog() == System.Windows.Forms.DialogResult.OK)
  4. {
  5. try
  6. {
  7. StreamReader arq = new StreamReader(openFileDialogPontos.FileName);
  8. string linha;
  9. while ((linha = arq.ReadLine()) != null)
  10. {
  11. string[] valores = linha.Split();
  12. float t = float.Parse(valores[0]);
  13. float s = float.Parse(valores[1]);
  14. Ponto p = new Ponto(t, s);
  15. reta.InserePonto(p);
  16. }
  17. MostraPontosGrafico();
  18. MostraAjusteGrafico();
  19. }
  20. catch
  21. {
  22. MessageBox.Show("Erro no arquivo de entrada!");
  23. }
  24. }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement