6677

Untitled

Nov 6th, 2013
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.34 KB | None | 0 0
  1. using System;
  2. using System.IO;
  3.  
  4. class Program
  5. {
  6.     static void Main()
  7.     {
  8.     //
  9.     // Read a line from a file the old way.
  10.     //
  11.     StreamReader reader = new StreamReader("file.txt");
  12.     string line = reader.ReadLine();
  13.     reader.Close();
  14.     // You should call Dispose on 'reader' here, too.
  15.     reader.Dispose();
  16.     Console.WriteLine(line);
  17.     }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment