Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.IO;
- class Program
- {
- static void Main()
- {
- //
- // Read a line from a file the old way.
- //
- StreamReader reader = new StreamReader("file.txt");
- string line = reader.ReadLine();
- reader.Close();
- // You should call Dispose on 'reader' here, too.
- reader.Dispose();
- Console.WriteLine(line);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment