Advertisement
spencerjohnson

Untitled

Jan 23rd, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 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.Threading.Tasks;
  9. using System.Windows.Forms;
  10. using System.IO;
  11.  
  12. namespace WindowsFormsApplication4
  13. {
  14. public partial class Form1 : Form
  15. {
  16. public Form1()
  17. {
  18. InitializeComponent();
  19. }
  20.  
  21. private void label2_Click(object sender, EventArgs e)
  22. {
  23.  
  24. }
  25. }
  26. }
  27. class Program
  28. {
  29. static void Main()
  30. {
  31. //
  32. // It will free resources on its own.
  33. //
  34. string line;
  35. using (StreamReader reader = new StreamReader("file.txt"))
  36. {
  37. line = reader.ReadLine();
  38. }
  39. Console.WriteLine(line);
  40. }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement