Guest User

Untitled

a guest
Jul 15th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. using System.IO;
  10.  
  11. namespace ReadFile
  12. {
  13. public partial class Form1 : Form
  14. {
  15. string filename = "";
  16. public Form1()
  17. {
  18. InitializeComponent();
  19. }
  20.  
  21. private void button1_Click(object sender, EventArgs e)
  22. {
  23. if (openFileDialog.ShowDialog() == DialogResult.Cancel)
  24. {
  25. MessageBox.Show("FIIIIIIIIIIIIIIICK");
  26. }
  27. else if (openFileDialog.ShowDialog() == DialogResult.OK)
  28. {
  29. filename = openFileDialog.FileName;
  30.  
  31. StreamReader read = new StreamReader(filename);
  32. textBox1.Text = read.ReadToEnd();
  33. }
  34. }
  35. }
  36. }
Add Comment
Please, Sign In to add comment