Reads strings from a file created in a text editor

image_pdfimage_print


   


using System;
using System.IO;

public class FileReadStrings {
  public static void Main( ) {
    String line;
    StreamReader f = new StreamReader("test.data");        
    while((line=f.ReadLine()) != null)                           
      Console.WriteLine(line);
    f.Close(); 
  }
}

//File: test.data
/*
4665 Street|Toronto|ON|90048
*/
           
          


This entry was posted in File Stream. Bookmark the permalink.