Advertisement
punidota

Untitled

Sep 13th, 2015
439
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.98 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.IO;
  8. using System.Text;
  9. using System.Threading.Tasks;
  10. using System.Windows.Forms;
  11.  
  12. namespace WindowsFormsApplication4
  13. {
  14.     public partial class Form1 : Form
  15.     {
  16.         public Form1()
  17.         {
  18.             InitializeComponent();
  19.         }
  20.  
  21.         private void выходToolStripMenuItem_Click(object sender, EventArgs e)
  22.         {
  23.             Environment.Exit(0);
  24.         }
  25.  
  26.         private void открытьToolStripMenuItem_Click(object sender, EventArgs e)
  27.         {
  28.             OpenFileDialog fd = new OpenFileDialog();
  29.             fd.DefaultExt = "*.*";
  30.             fd.ShowDialog();
  31.             using (StreamReader sr = new StreamReader("*.txt"))
  32.             {
  33.                
  34.                 String line = sr.ReadToEnd();
  35.                 label1.Text = sr.ToString();
  36.             }
  37.         }
  38.     }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement